From 7ee56e6714cb60bf7812bc0e2b68ca15242df394 Mon Sep 17 00:00:00 2001 From: Zdenek Devaty Date: Sat, 3 Feb 2024 14:50:04 +0100 Subject: [PATCH] Change ownURL to include public endpoint reroute --- apiserver/README.md | 2 +- apiserver/model_configuration.go | 2 +- conf/conf.go | 9 ++++++--- openapi.yaml | 2 +- saml/service_provider.go | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apiserver/README.md b/apiserver/README.md index 9bef0fd..8b14238 100644 --- a/apiserver/README.md +++ b/apiserver/README.md @@ -13,7 +13,7 @@ To see how to make this your own, look here: [README](https://openapi-generator.tech) - API version: 1.0.0 -- Build date: 2024-01-25T12:04:37.338334425Z[Etc/UTC] +- Build date: 2024-02-02T12:01:58.629258516Z[Etc/UTC] ### Running the server diff --git a/apiserver/model_configuration.go b/apiserver/model_configuration.go index ef19246..84affd8 100644 --- a/apiserver/model_configuration.go +++ b/apiserver/model_configuration.go @@ -45,7 +45,7 @@ type Configuration struct { // Normaly this value is set to false for a SP. If set to true the user has to re-authenticate (login at IdP) even it has a valid session to the IdP. ForceAuthn bool `json:"forceAuthn,omitempty"` - // If you have to use a customized Entity Id, you can overwrite it here. Normaly the default value can be leave as it is. + // If you have to use a customized Entity Id, you can overwrite it here. Normally the default value can be left as it is. EntityId string `json:"entityId,omitempty"` // only send cookies over encrypted connection (HTTPS) diff --git a/conf/conf.go b/conf/conf.go index 7cec583..2df3f00 100644 --- a/conf/conf.go +++ b/conf/conf.go @@ -307,16 +307,19 @@ func DeleteAllConfigurations(ctx context.Context) error { } func getElionaHost() string { - var eliDomain string - db := getDb() row := db.QueryRow("SELECT domain_name FROM eliona_config ;") + + var eliDomain string err := row.Scan(&eliDomain) if err != nil { log.Error(LOG_REGIO, "scan getElionaHost: %v", err) } - return eliDomain + publicEndpoint := "apps-public/saml-sso" + ownURL := eliDomain + publicEndpoint + + return ownURL } func getDb() *sql.DB { diff --git a/openapi.yaml b/openapi.yaml index 01016c7..5035832 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -348,7 +348,7 @@ components: default: false example: false entityId: - description: If you have to use a customized Entity Id, you can overwrite it here. Normaly the default value can be leave as it is. + description: If you have to use a customized Entity Id, you can overwrite it here. Normally the default value can be left as it is. type: string nullable: false readOnly: false diff --git a/saml/service_provider.go b/saml/service_provider.go index 1827340..a0ea910 100644 --- a/saml/service_provider.go +++ b/saml/service_provider.go @@ -57,7 +57,7 @@ func NewServiceProviderAdvanced(certificate string, privateKey string, baseUrl s idpMeta, err := samlsp.ParseMetadata(idpMetadata) if err != nil { log.Warn(LOG_REGIO, "cannot parse metadata. "+ - "continiue without, but cannot operate with a IdP in current state! ... %v", err) + "continuing without, but cannot operate with a IdP in current state! ... %v", err) // return nil, err }