Add Demonstrating Proof of Possession (DPoP) for Personal Access Tokens
-
Review changes -
-
Download -
Patches
-
Plain diff
What does this MR do and why?
This MR initiates the implementation of sender-constrained access tokens designed to minimise the risk of token leaks. I am putting this feature behind a feature flag.
Related to Sender constraining personal access tokens (#425130).
How to set up and validate locally
Currently this feature works only for RSA keys. Support for other algorithms will be added later.
For frontend:
- Checkout this branch locally.
- Run
bin/rails db:migrate
- In rails console, enable the feature flag:
Feature.enable(:dpop_authentication, User.first)
- Login as root.
- Go to Settings > Access tokens > Toggle the DPoP option.
- Confirm it persists in the database
User.first.dpop_enabled
and also on the frontend on refreshing the page.
For backend:
- Build
glab
from this branch. - Ensure DPoP is enabled following the steps above.
- Ensure you have an SSH key-pair setup with the public key uploaded to your user account. Ensure that the key type is saved as "Signing" or "Authentication and Signing".
- Using
glab
generate a DPoP header:bin/glab auth dpop-gen --pat "glpat-PAT" --private-key ~.ssh/id_rsa
- Use the generated header to make an HTTP API request:
curl http://localhost:3000/api/v4/projects --header "Private-Token: glpat-PAT" --header "DPoP: <GLAB OUTPUT HERE>"
- Confirm valid response is received. Confirm that the request fails without a valid DPoP header.
Edited by Ameya Darshan
Merge request reports
Compare and
Show latest version
- version 594389d855
- version 58867a1f63
- version 57519f9168
- version 564389d855
- version 5544443f2c
- version 5494a3e08b
- version 53b0ad9761
- version 52ca3b58cd
- version 5113a6cda0
- version 505d40a643
- version 49a6243570
- version 48711ffc72
- version 47a4933025
- version 46e78c3214
- version 459390e431
- version 44f17b6b10
- version 437e58736a
- version 42059f25ba
- version 41648e4cf6
- version 404ca15781
- version 398facbb5c
- version 38ef1b282f
- version 37d5eddcef
- version 36b4e83ae1
- version 35e815e86e
- version 34ea6d0133
- version 3397a6e433
- version 32f0977a2e
- version 31e2fb1c65
- version 306c418ff3
- version 2915986c49
- version 284bf137e2
- version 2700062c4f
- version 26fd68028a
- version 25f5505ae0
- version 2462dc7435
- version 238d5ef6d1
- version 221f429245
- version 21bd371875
- version 208a28b4f0
- version 1960bff03d
- version 1891019e52
- version 17ca5cee5d
- version 16e4ede019
- version 1524fc63fa
- version 144716fbcc
- version 1399178903
- version 1226048bfb
- version 11d70ccc51
- version 102f464723
- version 9bacd6e2c
- version 800d9812f
- version 77a48fded
- version 65e0e104e
- version 58c3eff3e
- version 4cbfb79a0
- version 3ddf8b3f8
- version 2461f947a
- version 15f2d45fe
- master (base)
- latest version11bf173d3 commits,
- version 594389d8552 commits,
- version 58867a1f634 commits,
- version 57519f91683 commits,
- version 564389d8552 commits,
- version 5544443f2c1 commit,
- version 5494a3e08b1 commit,
- version 53b0ad976130 commits,
- version 52ca3b58cd27 commits,
- version 5113a6cda026 commits,
- version 505d40a64325 commits,
- version 49a624357024 commits,
- version 48711ffc7223 commits,
- version 47a493302521 commits,
- version 46e78c321420 commits,
- version 459390e43119 commits,
- version 44f17b6b1017 commits,
- version 437e58736a16 commits,
- version 42059f25ba15 commits,
- version 41648e4cf611 commits,
- version 404ca1578110 commits,
- version 398facbb5c9 commits,
- version 38ef1b282f8 commits,
- version 37d5eddcef7 commits,
- version 36b4e83ae16 commits,
- version 35e815e86e4 commits,
- version 34ea6d01333 commits,
- version 3397a6e4332 commits,
- version 32f0977a2e1 commit,
- version 31e2fb1c6540 commits,
- version 306c418ff339 commits,
- version 2915986c4938 commits,
- version 284bf137e236 commits,
- version 2700062c4f35 commits,
- version 26fd68028a34 commits,
- version 25f5505ae033 commits,
- version 2462dc743532 commits,
- version 238d5ef6d131 commits,
- version 221f42924530 commits,
- version 21bd37187529 commits,
- version 208a28b4f028 commits,
- version 1960bff03d27 commits,
- version 1891019e5226 commits,
- version 17ca5cee5d25 commits,
- version 16e4ede01924 commits,
- version 1524fc63fa23 commits,
- version 144716fbcc23 commits,
- version 139917890322 commits,
- version 1226048bfb21 commits,
- version 11d70ccc5120 commits,
- version 102f46472319 commits,
- version 9bacd6e2c18 commits,
- version 800d9812f17 commits,
- version 77a48fded16 commits,
- version 65e0e104e16 commits,
- version 58c3eff3e16 commits,
- version 4cbfb79a015 commits,
- version 3ddf8b3f814 commits,
- version 2461f947a13 commits,
- version 15f2d45fe12 commits,
4 files
+ 77
− 57
Compare changes
- Side-by-side
- Inline
Files
4
Conflict: This file was modified in both the source and target branches.
Ask someone with write access to resolve it.
Loading