Repository navigation
Commit 2e2a0d3
Return Basic realm from CONTENT_ORIGIN in WWW-Authenticate header (#1640)
The OrgGroupAssignmentMixin.authenticate_header() was returning a static
"Bearer" value. When DRF denied an unauthenticated request to a
content-guarded PyPI view, the 401 response carried
WWW-Authenticate: Bearer instead of a Basic challenge that prompts
browsers for credentials.
Derive the realm from settings.CONTENT_ORIGIN so the header matches the
environment (e.g. packages.redhat.com vs packages.stage.redhat.com).
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 8d16109 commit 2e2a0d3
3 files changed
Lines changed: 8 additions & 4 deletions
File tree
- pulp_service/pulp_service
- app
- tests
- functional
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | | - | |
| 83 | + | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
0 commit comments