Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Remove redundant config field
Browse files Browse the repository at this point in the history
  • Loading branch information
zdevaty committed Jun 26, 2024
1 parent bbaac32 commit e301018
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 33 deletions.
2 changes: 1 addition & 1 deletion apiserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-06-26T08:43:07.565963939Z[Etc/UTC]
- Build date: 2024-06-26T08:44:30.583847215Z[Etc/UTC]


### Running the server
Expand Down
3 changes: 0 additions & 3 deletions apiserver/model_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ type Configuration struct {
// 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)
CookieSecure bool `json:"cookieSecure,omitempty"`

// The url to redirect if the login failed. If this value is null the default page /noLogin will showed up
LoginFailedUrl string `json:"loginFailedUrl,omitempty"`
}
Expand Down
1 change: 0 additions & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ func run() {
&config.AllowInitializationByIdp,
&config.SignedRequest,
&config.ForceAuthn,
&config.CookieSecure,
saml.PUBLIC_BASE_PATH,
)
if err != nil {
Expand Down
11 changes: 2 additions & 9 deletions appdb/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ func InsertAutoSamlConfiguration(ctx context.Context) error {
SignedRequest: AUTO_CNF_DEFAULT_SIGNING_REQ,
ForceAuthn: AUTO_CNF_DEFAULT_FORCE_AUTHN,
EntityID: AUTO_CNF_DEFAULT_ENTITY_ID,
CookieSecure: AUTO_CNF_DEFAULT_COOKIE_SECURE,
LoginFailedURL: AUTO_CNF_DEFAULT_LOGIN_FAIL_URL,
}
attributeMapping appdb.AttributeMap = appdb.AttributeMap{
Expand Down
2 changes: 0 additions & 2 deletions conf/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func ConfigApiToDbForm(config *apiserver.Configuration) (*appdb.Config, error) {
SignedRequest: config.SignedRequest,
ForceAuthn: config.ForceAuthn,
EntityID: config.EntityId,
CookieSecure: config.CookieSecure,
LoginFailedURL: config.LoginFailedUrl,
}, nil
}
Expand All @@ -58,7 +57,6 @@ func ConfigDbToApiForm(config *appdb.Config) (*apiserver.Configuration, error) {
SignedRequest: config.SignedRequest,
ForceAuthn: config.ForceAuthn,
EntityId: config.EntityID,
CookieSecure: config.CookieSecure,
LoginFailedUrl: config.LoginFailedURL,
}, nil
}
Expand Down
1 change: 0 additions & 1 deletion conf/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ CREATE TABLE IF NOT EXISTS saml_sp.config (
signed_request BOOLEAN NOT NULL DEFAULT true , -- sign the SAML request
force_authn BOOLEAN NOT NULL DEFAULT false ,
entity_id TEXT NOT NULL DEFAULT '{ownUrl}/apps-public/saml-sso/saml/metadata',
cookie_secure BOOLEAN NOT NULL DEFAULT false ,
login_failed_url TEXT NOT NULL DEFAULT '{ownUrl}/noLogin' -- redirect url when a user login fails
) ;

Expand Down
7 changes: 0 additions & 7 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,6 @@ components:
readOnly: false
default: "{ownUrl}/saml/metadata"
example: "{ownUrl}/saml/metadata"
cookieSecure:
description: Only send cookies over encrypted connection (HTTPS)
type: boolean
nullable: false
readOnly: false
default: false
example: false
loginFailedUrl:
description: The url to redirect if the login failed. If this value is null the default page /noLogin will showed up
type: string
Expand Down
10 changes: 3 additions & 7 deletions saml/service_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ func NewServiceProvider(certificate string, privateKey string, pubBaseUrl string
idpMetadata []byte) (*ServiceProvider, error) {

return NewServiceProviderAdvanced(certificate, privateKey, pubBaseUrl, idpMetadata, nil, nil,
nil, nil, nil, "")
nil, nil, "")
}

func NewServiceProviderAdvanced(certificate string, privateKey string, baseUrl string, idpMetadata []byte,
entityId *string, allowInitByIdp *bool, signedRequest *bool, forceAuthn *bool,
cookieSecure *bool, pubBasePath string) (*ServiceProvider, error) {
entityId *string, allowInitByIdp *bool, signedRequest *bool, forceAuthn *bool, pubBasePath string,
) (*ServiceProvider, error) {
var serviceProvider ServiceProvider = ServiceProvider{
pubBasePath: pubBasePath,
}
Expand Down Expand Up @@ -87,10 +87,6 @@ func NewServiceProviderAdvanced(certificate string, privateKey string, baseUrl s
if forceAuthn != nil {
opts.ForceAuthn = *forceAuthn
}
if cookieSecure != nil {
// opts.CookieSecure: true // option not available any more
log.Debug(LOG_REGIO, "cookie secure not implemented")
}

serviceProvider.sp, err = samlsp.New(opts)

Expand Down
1 change: 0 additions & 1 deletion utils/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func CreateRandomApiConfig() apiserver.Configuration {
SignedRequest: RandomBoolean(),
ForceAuthn: RandomBoolean(),
EntityId: RandomUrl() + "/" + RandomCharacter(5, false),
CookieSecure: RandomBoolean(),
LoginFailedUrl: RandomUrl() + "/" + RandomCharacter(RandomInt(2, 10), false),
}

Expand Down

0 comments on commit e301018

Please sign in to comment.