-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add PoP token support to interactive+spn get-token/convert-kubeconfig flows #319
Add PoP token support to interactive+spn get-token/convert-kubeconfig flows #319
Conversation
- When true, flag allows a PoP token to be passed (https://learn.microsoft.com/en-us/entra/msal/dotnet/advanced/proof-of-possession-tokens) instead of a regular bearer token - Flag is false by default (when not provided), i.e. the default flow is still to request a regular bearer token
- Adds a dependency on microsoft authentication library for go - Specifically uses the branch that adds PoP token support
- Use go-cmp to compare Options struct equality in unit test - Fix comment formatting to remove lint errors
Codecov Report
@@ Coverage Diff @@
## master #319 +/- ##
==========================================
+ Coverage 60.68% 66.66% +5.97%
==========================================
Files 16 22 +6
Lines 1249 1629 +380
==========================================
+ Hits 758 1086 +328
- Misses 445 485 +40
- Partials 46 58 +12
|
Add support for providing --pop-enabled and --pop-claims flags during kubelogin convert-kubeconfig. These flags are only set if login mode is set to interactive, otherwise the flags are ignored.
pkg/token/testdata/ServicePrincipalPoPTokenFromBadPoPClaimsVCR.yaml
Outdated
Show resolved
Hide resolved
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.
PTAL
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.
PTAL
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
Adds support for getting a Proof-of-Possession (PoP) token when running
kubelogin get-token
with--login interactive
mode.Adds 2 new flags to
kubelogin get-token
andkubelogin convert-kubeconfig
:--pop-enabled
: boolean flag indicating whether or not to request a PoP token--pop-claims
: string slice formatted as a comma-separated list of key/value pairs, eg."u=host,key2=val2"
Both flags must be provided together in order to use the PoP token flow; providing one but not the other will result in an error during flag validation. PoP claims must contain the
u
claim containing the ARM ID of the cluster (host) to request the PoP token for, in the format"u=<ARM_ID>"
.