Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logger and service providers fields initialization #529

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions samlidp/samlidp.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ func New(opts Options) (*Server, error) {
return s, nil
}

// InitializeLogger initialize the Server logger. (This function should be used only when
// not using the default New(opts Options) function where the logger
// object can be passed through the options)
func (s *Server) InitializeLogger(logger logger.Interface) {
if s != nil {
s.logger = logger
}
}

// InitializeHTTP sets up the HTTP handler for the server. (This function
// is called automatically for you by New, but you may need to call it
// yourself if you don't create the object using New.)
Expand Down
3 changes: 3 additions & 0 deletions samlidp/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ func (s *Server) HandlePutService(c web.C, w http.ResponseWriter, r *http.Reques
}

s.idpConfigMu.Lock()
if s.serviceProviders == nil {
s.serviceProviders = map[string]*saml.EntityDescriptor{}
}
s.serviceProviders[service.Metadata.EntityID] = &service.Metadata
s.idpConfigMu.Unlock()

Expand Down
Loading