Commit Graph

1246 Commits

Author SHA1 Message Date
Ryan Richard
bb9cb739c6 more unit tests for github in token_handler_test.go 2024-05-29 08:55:41 -07:00
Joshua Casey
cc8d637715 Fix lint 2024-05-28 20:33:55 -05:00
Joshua Casey
d3fb567fdb Add callback_handler tests for GitHub+IdentityTransformations
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-28 15:59:52 -05:00
Joshua Casey
8b1e5aa320 Add callback_handler tests to confirm GitHub with downstream form_post and GitHub with an error case
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-28 15:17:04 -05:00
Joshua Casey
37e654faa0 bunch of renames
Co-authored-by: Ryan Richard <richardry@vmware.com>
2024-05-28 13:41:52 -05:00
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
65682aa60d Add sample unit test for GitHub in token_handler_test.go 2024-05-22 23:04:15 -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
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
Joshua Casey
e4daa5a924 Merge branch 'main' into jtc/merge-main-at-3fe3cf71-into-github 2024-05-16 16:05:34 -05:00
Ryan Richard
7e0a3c114d Pinniped CLI and the oidc-client package are now enhanced by pinniped_supported_identity_provider_types
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-05-16 12:57:12 -05:00
Joshua Casey
a86d7d27c1 Add pinniped_supported_identity_provider_types to the IDP discovery endpoint 2024-05-16 12:55:45 -05:00
Joshua Casey
69364b2183 Merge branch 'main' into jtc/merge-main-at-6b3f175-into-github 2024-05-16 09:22:28 -05:00
Ryan Richard
e13f4a7f29 refactor ptls to clarify the difference between FIPS and non-FIPS modes
and backfill some basic tests
2024-05-13 16:52:15 -07:00
Joshua Casey
f43b6f04dc Fix lint issues from golangci-lint 1.58.1 2024-05-10 15:15:59 -05:00
Joshua Casey
791b785dea Merge branch 'main' into jtc/merge-main-at-d7849c79-to-github 2024-05-10 14:22:09 -05:00
Joshua Casey
81f3acfa38 Update some build tags since go1.22+ is now required 2024-05-10 12:51:03 -05:00
Joshua Casey
e9d0ac5110 Enable 'intrange' linter 2024-05-10 12:51:02 -05:00
Joshua Casey
7b36c8ab54 Enable 'copyloopvar' linter 2024-05-10 12:51:02 -05:00
Joshua Casey
e04e5e0185 Fix revive linter issues for all production code, and exclude revive linter issues for test code 2024-05-10 12:51:02 -05:00
Joshua Casey
67d3b5fb82 Fix misspell lint issues 2024-05-10 12:51:01 -05:00
Ryan Richard
0cdbb710d2 add test for github redirect in auth_handler_test.go
Co-authored-by: Joshua Casey <joshuatcasey@gmail.com>
2024-05-09 15:35:37 -07:00
Joshua Casey
75f024cb19 Fix lint 2024-05-09 15:35:37 -07:00
Joshua Casey
32e4e0d835 Add TestGenerateOTPCode 2024-05-09 15:35:37 -07:00
Ryan Richard
7c85a511a2 first draft of an e2e integration test for GitHub login (skip while WIP) 2024-05-09 15:35:37 -07:00
Ryan Richard
6be92f92fb bump Supervisor session storage versions 2024-05-09 15:35:37 -07:00
Ryan Richard
7277d00e1a refactor upstreamgithub.ProviderConfig to hold more config 2024-05-09 15:35:37 -07:00
Benjamin A. Petersen
29eb3dd384 Update GitHub UpstreamAuthorizeRedirectURL to generate URLs 2024-05-09 15:35:37 -07:00
Ryan Richard
afb032f8f9 Merge branch 'main' into github_identity_provider 2024-05-07 13:08:50 -07:00
Ryan Richard
85e5970d6e only auto-detect version v1 of ValidatingAdmissionPlugin during startup 2024-05-06 09:11:39 -07:00
Joshua Casey
e6cb439d9c Merge branch 'main' into ben/fuzzing-error-message 2024-05-02 12:12:18 -05:00
Benjamin A. Petersen
fbc3334e8c Improve TestFuzzAndJSONNewValidEmptyAuthorizeCodeSession message 2024-05-02 11:36:24 -04:00
Ryan Richard
ad7df9f7d1 don't remove user's ability to configure http port to listen on loopback 2024-05-01 12:36:39 -07:00
Joshua Casey
d67238d46f Remove code related to deprecated config params logLevel and HTTP networking 2024-05-01 12:36:39 -07:00
Ryan Richard
0a63dd104d fix test failures caused by dep bump and update replace statements 2024-05-01 11:01:13 -07:00
Benjamin A. Petersen
e0591500ce Update fuzz test 2024-05-01 12:57:00 -04:00
Benjamin A. Petersen
c43193a0c8 Merge branch 'main' into github_identity_provider 2024-05-01 12:15:08 -04:00
Ryan Richard
3bdb380a1a don't change public signature of endpointaddr.Parse() 2024-04-29 13:31:49 -07:00