Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrato committed Nov 6, 2024
1 parent 0d44107 commit cfd8aec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/auth/auth_with_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -3645,7 +3645,8 @@ func (a *ServerWithRoles) CreateSAMLConnector(ctx context.Context, connector typ
return nil, trace.Wrap(err)
}

if err := a.context.AuthorizeAdminAction(); err != nil {
// Support reused MFA for bulk tctl create requests.
if err := a.context.AuthorizeAdminActionAllowReusedMFA(); err != nil {
return nil, trace.Wrap(err)
}

Expand All @@ -3663,7 +3664,8 @@ func (a *ServerWithRoles) UpdateSAMLConnector(ctx context.Context, connector typ
return nil, trace.Wrap(err)
}

if err := a.context.AuthorizeAdminAction(); err != nil {
// Support reused MFA for bulk tctl create requests.
if err := a.context.AuthorizeAdminActionAllowReusedMFA(); err != nil {
return nil, trace.Wrap(err)
}

Expand Down
8 changes: 8 additions & 0 deletions lib/auth/integration/integrationv1/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ func (s *Service) CreateIntegration(ctx context.Context, req *integrationpb.Crea
return nil, trace.Wrap(err)
}

if err := authCtx.AuthorizeAdminActionAllowReusedMFA(); err != nil {
return nil, trace.Wrap(err)
}

if err := authCtx.CheckAccessToKind(types.KindIntegration, types.VerbCreate); err != nil {
return nil, trace.Wrap(err)
}
Expand Down Expand Up @@ -243,6 +247,10 @@ func (s *Service) UpdateIntegration(ctx context.Context, req *integrationpb.Upda
return nil, trace.Wrap(err)
}

if err := authCtx.AuthorizeAdminActionAllowReusedMFA(); err != nil {
return nil, trace.Wrap(err)
}

if err := authCtx.CheckAccessToKind(types.KindIntegration, types.VerbUpdate); err != nil {
return nil, trace.Wrap(err)
}
Expand Down

0 comments on commit cfd8aec

Please sign in to comment.