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

Initial changes for configure SSO for APPs from server #171

Merged
merged 10 commits into from
Aug 20, 2023
Merged

Conversation

indresh-28
Copy link
Collaborator

@indresh-28 indresh-28 commented Aug 18, 2023

Few code changes needed post discussion will update

server/main.go Outdated
@@ -0,0 +1,72 @@
package main
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't commit this test code, if needed keep it in examples

clientID, clientSecret, err := s.iam.GetSecrets(ctx, app.Config.AppName, app.Config.LaunchURL)
if err != nil {
s.log.Error("failed to get secrets from IAM for %s, err :%v", app.Config.AppName, err)
return err
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need to write error log when error is returned, caller support to log err

s.log.Error("failed to get cluster application from agent", err)
return &serverpb.NewClusterRegistrationResponse{Status: serverpb.StatusCode_INTERNRAL_ERROR,
StatusMessage: "failed to get cluster application from agent"}, nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should call GetLaunchUIConfig API instead of GetClusterApps

if err != nil {
s.log.Error("failed to connect to agent", err)
return err
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agent is already fetched in the registration, same can be reused passing the agent


// Invoke IAM module and get the creds.
// What should be the client Name unique??
clientID, clientSecret, err := s.iam.GetSecrets(ctx, app.Config.AppName, app.Config.LaunchURL)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method should named RegisterAppAsClient

CredIdentifier: "",
Credential: map[string]string{},
})

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fill the cred entityname and others from ENV

@vramk23 vramk23 merged commit 1ad82bd into main Aug 20, 2023
6 of 7 checks passed
@vramk23 vramk23 deleted the configure_app_sso branch April 3, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants