-
Notifications
You must be signed in to change notification settings - Fork 66
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
First draft of a GitHubIdentityProvider CRD #1900
First draft of a GitHubIdentityProvider CRD #1900
Conversation
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
// | ||
// +kubebuilder:default=Deny | ||
// +kubebuilder:validation:Enum=Allow;Deny | ||
AllowAllUsersToLogin GitHubAllowAllUsersToLoginSpec `json:"allowAllUsersToLogin"` |
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.
Is the naming sort of awkward that you can set a field called "AllowSomething" to have the value "Deny"? The field's name says it is about allowing something, not denying something.
Maybe name it something like AllowedUsers
, to be symmetrical with AllowedOrganizations
? Possible values would be something like:
OnlyUsersBelongingToAllowedOrganizations
(the default), which also makes it clear that it relates back to theAllowedOrganizations
fieldAllUsers
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.
It's definitely a little awkward.
How about GitHubOrganizationLoginPolicy
with AllowedOrganizationsOnly
as the default and AllOrganizationsAllowed
as the other option?
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.
I find it confusing that those names have substrings AllowedOrganizations
and OrganizationsAllowed
which makes them sound as if they are the same thing at first glance.
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.
Hmmm that makes sense. Let's chat tomorrow and capture the decision here.
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.
How about AllowedOrganizationsPolicy
? That name ties it back to the AllowedOrganizations
field.
We want the non-default value to emphasize the effect that it allows all GitHub users to authenticate regardless of org membership, even if they belong to no orgs. So how about enum values like OnlyUsersBelongingToSpecifiedOrgs
and AllGitHubUsers
.
So the settings in practice would look like:
spec:
allowedOrganizations: [vmware-tanzu, broadcom]
allowedOrganizationsPolicy: OnlyUsersBelongingToSpecifiedOrgs
or
spec:
allowedOrganizations: []
allowedOrganizationsPolicy: AllGitHubUsers
and because of the default values of the two settings, these would also be valid:
spec:
allowedOrganizations: [vmware-tanzu, broadcom]
and
spec:
allowedOrganizationsPolicy: AllGitHubUsers
The only configurations that allow all GitHub users must explicitly say AllGitHubUsers
because it is the non-default value. Kinda verbose but hopefully very clear.
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.
I like it
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.
Let's do this instead:
---
spec:
client:
secretName: foo
allowAuthentication:
organizations:
policy: OnlyUsersFromAllowedOrganizations
allowed:
- foo
- vmware-tanzu
- Broadcom
personalAccessTokens:
fineGrained: true
---
spec:
client:
secretName: foo
allowAuthentication:
organizations:
policy: AllGitHubUsers
personalAccessTokens:
classic: true
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## github_identity_provider #1900 +/- ##
============================================================
- Coverage 38.56% 38.24% -0.33%
============================================================
Files 350 354 +4
Lines 44514 44899 +385
============================================================
+ Hits 17169 17173 +4
- Misses 26831 27212 +381
Partials 514 514 ☔ View full report in Codecov by Sentry. |
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
9af03e1
to
400f721
Compare
db52f0a
to
ebfe439
Compare
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
f23067a
to
08826a0
Compare
Noting we can now rebase this on main. |
abccc26
to
c759147
Compare
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
type GitHubUsernameAttribute string | ||
|
||
const ( | ||
// GitHubUsernameID specifies using the `id` attribute from the GitHub user as the downstream username. |
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.
Maybe try to avoid using the term "downstream" in all the comments?
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
apis/supervisor/idp/v1alpha1/types_githubidentityprovider.go.tmpl
Outdated
Show resolved
Hide resolved
…pp-and-ytt-enhancements Revise log level instructions for kapp and kubectl in docs
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.
LGTM, I tend to agree with dropping the simple CEL validations since we have to do more sophisticated in the controller anyway. 👍
aad0085
to
42dd8d1
Compare
See #1859