ContainerImage.Pinniped/internal
Ryan Richard 22fbced863 Create username scope, required for clients to get username in ID token
- For backwards compatibility with older Pinniped CLIs, the pinniped-cli
  client does not need to request the username or groups scopes for them
  to be granted. For dynamic clients, the usual OAuth2 rules apply:
  the client must be allowed to request the scopes according to its
  configuration, and the client must actually request the scopes in the
  authorization request.
- If the username scope was not granted, then there will be no username
  in the ID token, and the cluster-scoped token exchange will fail since
  there would be no username in the resulting cluster-scoped ID token.
- The OIDC well-known discovery endpoint lists the username and groups
  scopes in the scopes_supported list, and lists the username and groups
  claims in the claims_supported list.
- Add username and groups scopes to the default list of scopes
  put into kubeconfig files by "pinniped get kubeconfig" CLI command,
  and the default list of scopes used by "pinniped login oidc" when
  no list of scopes is specified in the kubeconfig file
- The warning header about group memberships changing during upstream
  refresh will only be sent to the pinniped-cli client, since it is
  only intended for kubectl and it could leak the username to the
  client (which may not have the username scope granted) through the
  warning message text.
- Add the user's username to the session storage as a new field, so that
  during upstream refresh we can compare the original username from the
  initial authorization to the refreshed username, even in the case when
  the username scope was not granted (and therefore the username is not
  stored in the ID token claims of the session storage)
- Bump the Supervisor session storage format version from 2 to 3
  due to the username field being added to the session struct
- Extract commonly used string constants related to OIDC flows to api
  package.
- Change some import names to make them consistent:
  - Always import github.com/coreos/go-oidc/v3/oidc as "coreosoidc"
  - Always import go.pinniped.dev/generated/latest/apis/supervisor/oidc
    as "oidcapi"
  - Always import go.pinniped.dev/internal/oidc as "oidc"
2022-08-08 16:29:22 -07:00
..
apiserviceref Use API service as owner ref for cluster scoped resources 2021-02-10 21:52:08 -05:00
authenticators Don't do ldap group search when group scope not specified 2022-06-22 10:58:08 -07:00
certauthority Bump to go1.18.1 and fix linter errors 2022-04-13 16:43:06 -04:00
clusterhost Introduce clusterhost package to determine whether a cluster has control plane nodes 2021-02-09 11:16:01 -08:00
concierge Switch to go.uber.org/zap for JSON formatted logging 2022-05-24 11:17:42 -04:00
config Updates based on code review 2022-06-15 09:38:21 -07:00
constable Save 2 lines by using inline-style comments for Copyright 2020-09-16 10:35:19 -04:00
controller Create username scope, required for clients to get username in ID token 2022-08-08 16:29:22 -07:00
controllerinit kubecertagent: fix flakey tests 2021-09-16 14:48:04 -04:00
controllerlib Switch to go.uber.org/zap for JSON formatted logging 2022-05-24 11:17:42 -04:00
controllermanager Switch to go.uber.org/zap for JSON formatted logging 2022-05-24 11:17:42 -04:00
crud Allow dynamic clients to be used in downstream OIDC flows 2022-07-14 09:51:11 -07:00
crypto/ptls Switch to go.uber.org/zap for JSON formatted logging 2022-05-24 11:17:42 -04:00
deploymentref Allow configuration of supervisor endpoints 2022-01-18 17:43:45 -05:00
downward internal/downward: add support for (optional) pod name 2020-12-11 11:49:27 -05:00
dynamiccert Bump project deps, including kube 0.23.6->0.24.1 and Go 1.18.1->1.18.3 2022-06-07 15:26:30 -04:00
endpointaddr Add endpointaddr pkg for parsing host+port inputs. 2021-05-25 16:17:26 -05:00
execcredcache Add CLI caching of cluster-specific credentials. 2021-04-08 14:12:34 -05:00
fositestorage Create username scope, required for clients to get username in ID token 2022-08-08 16:29:22 -07:00
fositestoragei More adjustments based on PR feedback 2021-04-27 16:54:26 -07:00
groupsuffix Change group names 2022-06-13 14:28:05 -07:00
here Save 2 lines by using inline-style comments for Copyright 2020-09-16 10:35:19 -04:00
httputil Force the use of secure TLS config 2021-11-17 16:55:35 -05:00
issuer dynamiccert: split into serving cert and CA providers 2021-03-15 12:24:07 -04:00
kubeclient Bump project deps, including kube 0.23.6->0.24.1 and Go 1.18.1->1.18.3 2022-06-07 15:26:30 -04:00
leaderelection Ensure concierge and supervisor gracefully exit 2021-08-30 20:29:52 -04:00
localuserauthenticator Switch to go.uber.org/zap for JSON formatted logging 2022-05-24 11:17:42 -04:00
mocks Merge branch 'main' into upstream_access_revocation_during_gc 2022-01-14 10:49:22 -08:00
net/phttp Update to github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.2 2022-03-08 12:28:09 -08:00
oidc Create username scope, required for clients to get username in ID token 2022-08-08 16:29:22 -07:00
oidcclientsecretstorage Allow dynamic clients to be used in downstream OIDC flows 2022-07-14 09:51:11 -07:00
ownerref internal/groupsuffix: mutate TokenCredentialRequest's Authenticator 2021-02-10 15:53:44 -05:00
plog Switch to go.uber.org/zap for JSON formatted logging 2022-05-24 11:17:42 -04:00
psession Create username scope, required for clients to get username in ID token 2022-08-08 16:29:22 -07:00
registry Updates based on code review 2022-06-15 09:38:21 -07:00
secret All controller unit tests should not cancel context until test is over 2021-03-04 17:26:01 -08:00
supervisor Be extra defensive and don't lookup dynamic client ID's lacking prefix 2022-07-22 15:19:19 -07:00
testutil Create username scope, required for clients to get username in ID token 2022-08-08 16:29:22 -07:00
upstreamldap Create username scope, required for clients to get username in ID token 2022-08-08 16:29:22 -07:00
upstreamoidc Create username scope, required for clients to get username in ID token 2022-08-08 16:29:22 -07:00
valuelesscontext valuelesscontext: make unit tests more clear 2021-04-30 10:43:29 -04:00