Skip to content

Commit

Permalink
make sure we only set the "sandbox" scope for Kaiser in the sandbox e…
Browse files Browse the repository at this point in the history
…nvironment.
  • Loading branch information
AnalogJ committed Jan 25, 2024
1 parent 7bf5b71 commit d609a7f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 1 addition & 4 deletions definitions/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ func GetSourceDefinition(
if err != nil {
return nil, fmt.Errorf("error retrieving platform definition (%s): %w", platformType, err)
}
//TODO: merge endpoint data into platform definition

//platform environment specific customizations happen in Populate method
platformDefinition.Populate(&endpoint, options.Env, options.ClientIdLookup)

return platformDefinition, err
Expand All @@ -93,8 +92,6 @@ func getPlatformDefinition(platformType pkg.PlatformType) (*models.LighthouseSou
return nil, fmt.Errorf("error retrieving platform definition (%s): %w", platformType, err)
}

//TODO: set the platform environment specific customizations

return platformDefinition, nil
}

Expand Down
6 changes: 5 additions & 1 deletion definitions/models/lighthouse_endpoint_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ func (def *LighthouseSourceDefinition) Populate(
def.IntrospectionEndpoint = "https://authorization.cerner.com/tokeninfo"
}

def.Issuer = def.Url
if def.PlatformType == pkg.PlatformTypeKaiser && env == pkg.FastenLighthouseEnvSandbox {
def.Scopes = append(def.Scopes, "sandbox")
}

//Common defaults. All customizations should be above this line
def.Issuer = def.Url
// retrieve client-id, if available
if clientId, clientIdOk := clientIdLookup[def.PlatformType]; clientIdOk {
def.ClientId = clientId
Expand Down
2 changes: 1 addition & 1 deletion definitions/platform/kaiser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ scopes_supported:
- patient/*.read
- launch/patient
- offline_access
- sandbox
# - sandbox # this scope will be added dynamically depending on the Lighthouse environment (required for sandbox, not for production)
grant_types_supported:
- authorization_code
response_types_supported:
Expand Down

0 comments on commit d609a7f

Please sign in to comment.