Multiple grant scope IDs (#4251)

Co-authored-by: Timothy Messier <tim.messier@gmail.com>
Co-authored-by: Todd <github@quaddi.com>
This commit is contained in:
authored and GitHub committed 2024-01-23 14:33:09 -05:00
1 parent 659df2797c
commit f5dd457b34
70 files changed
+5460 -1009

No files matched your search

+16 -5
View File
@@ -114,11 +114,19 @@ func (b *Server) CreateDevDatabase(ctx context.Context, opt ...Option) error {
return err
}
if _, err := b.CreateInitialLoginRole(ctx); err != nil {
if c != nil {
err = errors.Join(err, c())
if !opts.withSkipDefaultRoleCreation {
if _, err := b.CreateInitialLoginRole(ctx); err != nil {
if c != nil {
err = errors.Join(err, c())
}
return err
}
if _, err := b.CreateInitialAuthenticatedUserRole(ctx, WithAuthUserTargetAuthorizeSessionGrant(true)); err != nil {
if c != nil {
err = errors.Join(err, c())
}
return err
}
return err
}
if opts.withSkipAuthMethodCreation {
@@ -151,7 +159,10 @@ func (b *Server) CreateDevDatabase(ctx context.Context, opt ...Option) error {
return nil
}
if _, _, err := b.CreateInitialScopes(ctx); err != nil {
if _, _, err := b.CreateInitialScopes(ctx, WithIamOptions(
iam.WithSkipAdminRoleCreation(true),
iam.WithSkipDefaultRoleCreation(true),
)); err != nil {
return err
}