Skip to content

Commit 9c0682b

Browse files
committed
fix(auth): remove Sentinel scope bypass
1 parent 2f4cddb commit 9c0682b

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

depot/api/api.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,6 @@ func RequestTokenExists(c *gin.Context) bool {
171171
return exists
172172
}
173173

174-
func RequestTokenHasScope(c *gin.Context, scope string) bool {
175-
for _, tokenScope := range strings.Fields(GetRequestTokenScopes(c)) {
176-
if tokenScope == scope {
177-
return true
178-
}
179-
}
180-
return false
181-
}
182-
183174
func RequestTokenHasGroupName(c *gin.Context, groupName string) bool {
184175
for _, tokenGroup := range GetRequestTokenGroupNames(c) {
185176
if tokenGroup == groupName {
@@ -209,14 +200,10 @@ const AdminGroupName = "DepotAdmins"
209200
// the token must have been minted for Depot's own OAuth client, and its entity
210201
// must belong to the DepotAdmins group. An application token can never
211202
// reshape Depot regardless of what its entity's group memberships say.
212-
// sentinel:all remains as first-party break-glass for Sentinel's own tooling.
213203
func RequestTokenIsAdmin(c *gin.Context) bool {
214204
if !RequestTokenExists(c) {
215205
return false
216206
}
217-
if RequestTokenHasScope(c, "sentinel:all") {
218-
return true
219-
}
220207
return RequestTokenIsFirstParty(c) && RequestTokenHasGroupName(c, AdminGroupName)
221208
}
222209

0 commit comments

Comments
 (0)