-
Notifications
You must be signed in to change notification settings - Fork 503
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
✨ New probe for required MFA #4398
Conversation
Signed-off-by: Eddie Knight <[email protected]>
1b9a198
to
db71e3d
Compare
db71e3d
to
76b2b23
Compare
76b2b23
to
bd121c3
Compare
Signed-off-by: Eddie Knight <[email protected]> linting Signed-off-by: Eddie Knight <[email protected]> updated docs Signed-off-by: Eddie Knight <[email protected]>
75aa405
to
77aeb54
Compare
Note that this follows #4391 |
@@ -204,6 +204,17 @@ func (client *Client) GetCreatedAt() (time.Time, error) { | |||
return client.repo.CreatedAt.Time, nil | |||
} | |||
|
|||
func (client *Client) GetMFARequired() (required bool, err error) { | |||
org, _, err := client.repoClient.Organizations.Get(context.Background(), client.repourl.owner) |
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.
Could we add e2e tests of this on:
- repo owned by a user
- repo owned by an organization
@@ -236,6 +236,11 @@ func (client *Client) GetCreatedAt() (time.Time, error) { | |||
return client.project.getCreatedAt() | |||
} | |||
|
|||
func (c *Client) GetMFARequired() (required bool, err error) { |
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.
Appears this is available on GitLab for group namespaces as well:
https://docs.gitlab.com/ee/api/groups.html
motivation: > | ||
What is the motivation for this probe? | ||
implementation: > | ||
How does this probe work under-the-hood? |
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.
Could you add these fields to the documentation?
Co-authored-by: Raghav Kaul <[email protected]> Signed-off-by: Eddie Knight <[email protected]>
GetDefaultBranch() (*BranchRef, error) | ||
GetMFARequired() (bool, error) |
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.
We may want to reach a decision on #4049
This is technically a breaking change.
What kind of change does this PR introduce?
New Probe to check whether an organization has MFA enabled. Requires an authorized token. Only supports GitHub in the present state.
What is the current behavior?
What is the new behavior (if this is a feature change)?**
Which issue(s) this PR fixes
NONE
Special notes for your reviewer
Does this PR introduce a user-facing change?
For user-facing changes, please add a concise, human-readable release note to
the
release-note
(In particular, describe what changes users might need to make in their
application as a result of this pull request.)