diff --git a/deploy/templates/service-template.yml b/deploy/templates/service-template.yml index d0c41ed..1e6de03 100644 --- a/deploy/templates/service-template.yml +++ b/deploy/templates/service-template.yml @@ -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 @@ -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: diff --git a/internal/auth/auth.go b/internal/auth/auth.go index d7e8f1a..752469c 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -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() } diff --git a/internal/config/config.go b/internal/config/config.go index 3a502aa..92c7704 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -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 { @@ -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", @@ -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