-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
server/main.go
Outdated
@@ -0,0 +1,72 @@ | |||
package main |
There was a problem hiding this comment.
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
server/pkg/api/cluster_apps.go
Outdated
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 |
There was a problem hiding this comment.
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 | ||
} |
There was a problem hiding this comment.
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
server/pkg/api/cluster_apps.go
Outdated
if err != nil { | ||
s.log.Error("failed to connect to agent", err) | ||
return err | ||
} |
There was a problem hiding this comment.
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
server/pkg/api/cluster_apps.go
Outdated
|
||
// 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) |
There was a problem hiding this comment.
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{}, | ||
}) | ||
|
There was a problem hiding this comment.
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
Few code changes needed post discussion will update