Commit Graph

4200 Commits

Author SHA1 Message Date
Ryan Richard
f323690049 refactor upstream refresh test helpers to be more specific to IDP type 2024-05-23 13:35:31 -07:00
Joshua Casey
02ffff01d5 fix lint 2024-05-23 12:32:18 -05:00
Joshua Casey
2cdeb85cd6 Merge pull request #1967 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-23 12:29:41 -05:00
Pinny
6ea7c48ae9 Bump dependencies 2024-05-23 13:01:01 +00:00
Joshua Casey
65682aa60d Add sample unit test for GitHub in token_handler_test.go 2024-05-22 23:04:15 -05:00
Ryan Richard
bb1737daec slow down github integration tests to avoid OTP reuse errors from github 2024-05-22 21:21:45 -05:00
Ryan Richard
fef494949f implement upstream refresh for github 2024-05-22 21:21:45 -05:00
Ryan Richard
0a15d488c8 Merge callback_handler_github_test.go into callback_handler_test.go
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-05-22 21:21:45 -05:00
Ryan Richard
e69eb46911 Add github integration tests to supervisor_login_test.go
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-05-22 21:21:45 -05:00
Ryan Richard
8f8db3f542 Make github org comparison case-insensitive, but return original case
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-05-22 21:21:45 -05:00
Ryan Richard
8923704f3c Finish initial github login flow
Also:
- fix github teams query: fix bug and sort/unique the results
- add IDP display name to github downstream subject
- fix error types returned by LoginFromCallback
- add trace logs to github API results
- update e2e test
- implement placeholder version of refresh for github
2024-05-22 21:21:45 -05:00
Joshua Casey
ba2d122308 fix lint 2024-05-22 21:21:45 -05:00
Joshua Casey
938bea9910 upstreamgitub.go now uses githubclient to determine username and groups 2024-05-22 21:21:45 -05:00
Joshua Casey
8719c7a2db Standardize error messages and url handling within NewGitHubClient
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-22 21:21:45 -05:00
Ryan Richard
16fa12f455 Handle empty or invalid github API responses
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-05-22 21:21:45 -05:00
Joshua Casey
555b1c80e3 Use passed-in context
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-22 21:21:45 -05:00
Joshua Casey
a12a5f387a Empty allowedOrganizations will return all teams
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-22 21:21:45 -05:00
Joshua Casey
c087e33b86 Add client wrapper for github.com/google/go-github/v62 2024-05-22 21:21:45 -05:00
Ryan Richard
49c468f00a Add GetUser() interface and implement LoginFromCallback() for GitHub
ALso fixed some of the GitHub test helpers
2024-05-22 21:21:45 -05:00
Joshua Casey
b7f79f0adc Add github-specific tests in callback_handler_github_test.go
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-22 21:21:45 -05:00
Ryan Richard
2756a106a9 Merge pull request #1966 from vmware-tanzu/jtc/add-docs-for-github-app
Add docs for GitHub app and GitHub OAuth app
2024-05-22 15:04:38 -07:00
Ryan Richard
efffa0def2 document creating GitHub OAuth App 2024-05-22 15:03:09 -07:00
Joshua Casey
6beb1c135c Add docs for GitHub App configuration on github.com 2024-05-22 16:25:42 -05:00
Joshua Casey
24ab2e85e5 Merge pull request #1965 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-22 13:27:11 -05:00
Joshua Casey
c6749560b5 Fix plog test assertions that contain the plog library version 2024-05-22 09:35:16 -05:00
Pinny
a0160b8e47 Bump dependencies 2024-05-22 13:01:15 +00:00
Joshua Casey
2f9df8c8e2 Add module generate command and update all generated files 2024-05-21 10:43:52 -05:00
Joshua Casey
0076f1251c Move all mock files into internal/mocks and use mock prefix 2024-05-21 10:38:25 -05:00
Joshua Casey
fe911a7b7a Prefer slices package and slices.Concat where possible 2024-05-21 09:31:16 -05:00
Joshua Casey
bdd79a9984 Enforce more imports
- go.pinniped.dev/generated/latest/client/concierge/clientset/versioned/fake
- go.pinniped.dev/generated/latest/client/supervisor/clientset/versioned/fake
- go.pinniped.dev/generated/latest/client/concierge/informers/externalversions
- go.pinniped.dev/generated/latest/client/supervisor/informers/externalversions
2024-05-21 09:31:15 -05:00
Joshua Casey
513f43f465 Enforce more imports
- go.pinniped.dev/generated/latest/apis/concierge/config/v1alpha1
- go.pinniped.dev/generated/latest/client/concierge/clientset/versioned
- go.pinniped.dev/generated/latest/client/concierge/clientset/versioned/scheme
- go.pinniped.dev/generated/latest/client/supervisor/clientset/versioned
- go.pinniped.dev/generated/latest/client/supervisor/clientset/versioned/scheme
2024-05-21 09:31:15 -05:00
Joshua Casey
f5116cddb4 Enable 'makezero' and 'prealloc' linters, and require 'any' instead of 'interface{}'
Enforce importas:

- go.pinniped.dev/generated/latest/apis/supervisor/config/v1alpha1
- go.pinniped.dev/generated/latest/apis/supervisor/idp/v1alpha1
2024-05-21 09:31:15 -05:00
Joshua Casey
bbe10004b4 Enforce more imports
- go.pinniped.dev/generated/latest/apis/supervisor/clientsecret/v1alpha1
- go.pinniped.dev/internal/concierge/scheme
2024-05-21 09:31:15 -05:00
Joshua Casey
e9252a9ee3 Enforce more imports
- k8s.io/apimachinery/pkg/apis/meta/v1
- k8s.io/api/core/v1
- github.com/coreos/go-oidc/v3/oidc
- github.com/ory/fosite/handler/oauth2
- go.pinniped.dev/generated/latest/apis/concierge/authentication/v1alpha1
2024-05-21 09:31:15 -05:00
Joshua Casey
875b0739aa Enforce aliases for 'k8s.io/apimachinery/pkg/util/errors' and 'k8s.io/apimachinery/pkg/api/errors' 2024-05-21 09:31:15 -05:00
Joshua Casey
7f56115abc Merge pull request #1964 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-21 08:56:10 -05:00
Pinny
5a29f19faa Bump dependencies 2024-05-21 13:02:31 +00:00
Joshua Casey
ae45e158a3 Merge pull request #1962 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-20 10:02:00 -05:00
Pinny
81c44528ba Bump dependencies 2024-05-20 13:02:19 +00:00
Ryan Richard
9cfb6baaf2 Merge pull request #1961 from vmware-tanzu/pinny/bump-deps
Bump dependencies
2024-05-17 14:12:20 -07:00
Pinny
1de902fe8d Bump dependencies 2024-05-17 13:02:24 +00:00
Joshua Casey
7ac141ba08 Merge pull request #1960 from vmware-tanzu/jtc/merge-main-at-3fe3cf71-into-github
Merge main at `3fe3cf71` into `github_identity_provider`
2024-05-16 20:37:42 -05:00
Joshua Casey
fd7838ef2c Add 'github' as an example to the 'pinniped login oidc --upstream-identity-provider-type' help text 2024-05-16 16:22:13 -05:00
Joshua Casey
7ffb1de1c9 Merge branch 'github_identity_provider' into jtc/merge-main-at-3fe3cf71-into-github 2024-05-16 16:07:30 -05:00
Joshua Casey
e4daa5a924 Merge branch 'main' into jtc/merge-main-at-3fe3cf71-into-github 2024-05-16 16:05:34 -05:00
Joshua Casey
147022234e Merge pull request #1959 from vmware-tanzu/github_hack_prepare_supervisor
update hack/prepare-supervisor-on-kind.sh for GitHub IDPs
2024-05-16 16:04:41 -05:00
Ryan Richard
2054708c53 update hack/prepare-supervisor-on-kind.sh for GitHub IDPs 2024-05-16 13:49:53 -07:00
Ryan Richard
3fe3cf71ab Merge pull request #1928 from vmware-tanzu/jtc/add-idp-type-discovery
Add `pinniped_supported_identity_provider_types` to the IDP discovery endpoint
2024-05-16 13:06:38 -07:00
Joshua Casey
7787885463 Add federation domain cleanup in E2E integration test
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-16 14:18:43 -05:00
Ryan Richard
f320980006 Add integration test to prove that 'pinniped login oidc' will infer the flowtype from the Supervisor's IDP discovery
Co-authored-by: Joshua T Casey <caseyj@vmware.com>
2024-05-16 12:57:33 -05:00