File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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-
183174func 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.
213203func 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
You can’t perform that action at this time.
0 commit comments