Skip to content

Commit

Permalink
Add MIGRATION_PLANNER_AUTH env var
Browse files Browse the repository at this point in the history
Signed-off-by: Ondra Machacek <omachace@redhat.com>
  • Loading branch information
machacekondra committed Feb 20, 2025
1 parent dc4a558 commit 2a3f1aa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 8 additions & 0 deletions deploy/templates/service-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ parameters:
- name: MIGRATION_PLANNER_UI_URL
description: The console URL of the migration assessment
required: true
- name: MIGRATION_PLANNER_JWK_URL
description: URL of the x.509 certificate chain that was used to verify the digital signature of the JWT
- name: MIGRATION_PLANNER_AUTH
description: Define the backend authentication mechanism
- name: DB_SECRET_NAME
description: The name of the OpenShift Secret used for the database.
displayName: Database Secret Name
Expand Down Expand Up @@ -114,6 +118,10 @@ objects:
value: ${MIGRATION_PLANNER_AGENT_IMAGE}:${IMAGE_TAG}
- name: BASE_AGENT_ENDPOINT_URL
value: ${MIGRATION_PLANNER_URL}
- name: MIGRATION_PLANNER_AUTH
value: ${MIGRATION_PLANNER_AUTH}
- name: MIGRATION_PLANNER_JWK_URL
value: ${MIGRATION_PLANNER_JWK_URL}
- name: DB_HOST
valueFrom:
secretKeyRef:
Expand Down
2 changes: 1 addition & 1 deletion internal/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewAuthenticator(authConfig config.Auth) (Authenticator, error) {

switch authConfig.AuthenticationType {
case RHSSOAuthentication:
return NewRHSSOAuthenticator(authConfig.JwtCertUrl)
return NewRHSSOAuthenticator(authConfig.JwkCertURL)
default:
return NewNoneAuthenticator()
}
Expand Down
14 changes: 9 additions & 5 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type kafkaConfig struct {

type Auth struct {
AuthenticationType string `json:"type"`
JwtCertUrl string `json:"jwt_cert_url"`
JwkCertURL string `json:"jwk_cert_url"`
}

func ConfigDir() string {
Expand All @@ -68,10 +68,10 @@ func ClientConfigFile() string {
}

func NewDefault() (*Config, error) {
port, err := util.GetIntEnv("DB_PORT", 5432)
if err != nil {
return nil, err
}
port, err := util.GetIntEnv("DB_PORT", 5432)
if err != nil {
return nil, err
}
c := &Config{
Database: &dbConfig{
Type: "pgsql",
Expand All @@ -89,6 +89,10 @@ func NewDefault() (*Config, error) {
BaseAgentEndpointUrl: "https://localhost:7443",
BaseImageEndpointUrl: "https://localhost:11443",
LogLevel: "info",
Auth: Auth{
AuthenticationType: util.GetEnv("MIGRATION_PLANNER_AUTH", "none"),
JwkCertURL: util.GetEnv("MIGRATION_PLANNER_JWK_URL", ""),
},
},
}
return c, nil
Expand Down

0 comments on commit 2a3f1aa

Please sign in to comment.