Skip to content
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
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func (s *Server) AssignRole(ctx context.Context, req *minder.AssignRoleRequest)
if !isMachine && flags.Bool(ctx, s.featureFlags, flags.UserManagement) {
return nil, util.UserVisibleError(codes.Unimplemented, "human users may only be added by invitation")
}
if isMachine && !flags.Bool(ctx, s.featureFlags, flags.MachineAccounts) {
if isMachine {
Copy link
Member

Choose a reason for hiding this comment

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

Ooh, this is tricky, since this is a negative use of the flag -- in this case, I think flags.Bool(ctx, s.featureFlags, flags.MachineAccounts) should effectively always return true, so if isMachine && !true will always evaluate to false, and the entire if false {...} block can be removed.

return nil, util.UserVisibleError(codes.Unimplemented, "machine accounts are not enabled")
}
assignment, err := db.WithTransaction(s.store, func(qtx db.ExtendQuerier) (*minder.RoleAssignment, error) {
Expand Down
2 changes: 0 additions & 2 deletions pkg/flags/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ const (
DockerHubProvider Experiment = "dockerhub_provider"
// GitLabProvider enables the GitLab provider.
GitLabProvider Experiment = "gitlab_provider"
// MachineAccounts enables machine accounts (in particular, GitHub Actions) for authorization
MachineAccounts Experiment = "machine_accounts"
// AlternateMessageDriver enables an an alternate message driver.
AlternateMessageDriver Experiment = "alternate_message_driver"
// GitPRDiffs enables the git ingester for pull requests.
Expand Down
Loading