mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-02-14 18:10:17 +00:00
Add github to login_oidc.go
This commit is contained in:
@@ -304,7 +304,8 @@ func flowOptions(
|
||||
}
|
||||
|
||||
switch requestedIDPType {
|
||||
case idpdiscoveryv1alpha1.IDPTypeOIDC:
|
||||
// TODO(BEN): previously i had put a panic("GitHub NOPE") here. Now its time to work out the details of doing an actual GitHub Login....
|
||||
case idpdiscoveryv1alpha1.IDPTypeOIDC, idpdiscoveryv1alpha1.IDPTypeGitHub:
|
||||
switch requestedFlow {
|
||||
case idpdiscoveryv1alpha1.IDPFlowCLIPassword:
|
||||
return useCLIFlow, nil
|
||||
@@ -328,9 +329,6 @@ func flowOptions(
|
||||
flowSource, requestedIDPType, requestedFlow,
|
||||
strings.Join([]string{idpdiscoveryv1alpha1.IDPFlowCLIPassword.String(), idpdiscoveryv1alpha1.IDPFlowBrowserAuthcode.String()}, ", "))
|
||||
}
|
||||
// TODO: implement this
|
||||
case idpdiscoveryv1alpha1.IDPTypeGitHub:
|
||||
panic("GitHub has not been implemented yet.")
|
||||
default:
|
||||
// Surprisingly cobra does not support this kind of flag validation. See https://github.com/spf13/pflag/issues/236
|
||||
return nil, fmt.Errorf(
|
||||
@@ -340,6 +338,7 @@ func flowOptions(
|
||||
idpdiscoveryv1alpha1.IDPTypeOIDC.String(),
|
||||
idpdiscoveryv1alpha1.IDPTypeLDAP.String(),
|
||||
idpdiscoveryv1alpha1.IDPTypeActiveDirectory.String(),
|
||||
idpdiscoveryv1alpha1.IDPTypeGitHub.String(),
|
||||
}, ", "),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ func TestLoginOIDCCommand(t *testing.T) {
|
||||
},
|
||||
wantError: true,
|
||||
wantStderr: here.Doc(`
|
||||
Error: --upstream-identity-provider-type value not recognized: invalid (supported values: oidc, ldap, activedirectory)
|
||||
Error: --upstream-identity-provider-type value not recognized: invalid (supported values: oidc, ldap, activedirectory, github)
|
||||
`),
|
||||
},
|
||||
{
|
||||
@@ -173,7 +173,7 @@ func TestLoginOIDCCommand(t *testing.T) {
|
||||
env: map[string]string{"PINNIPED_UPSTREAM_IDENTITY_PROVIDER_FLOW": "browser_authcode"},
|
||||
wantError: true,
|
||||
wantStderr: here.Doc(`
|
||||
Error: --upstream-identity-provider-type value not recognized: invalid (supported values: oidc, ldap, activedirectory)
|
||||
Error: --upstream-identity-provider-type value not recognized: invalid (supported values: oidc, ldap, activedirectory, github)
|
||||
`),
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user