[GITEA] silently ignore obsolete sudo scope
Fixes: https://codeberg.org/forgejo/forgejo/issues/820
(cherry picked from commit 6a7022ebbb)
			
			
This commit is contained in:
		
							parent
							
								
									15e6e2c7d7
								
							
						
					
					
						commit
						764eac47b5
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -250,7 +250,7 @@ func (s AccessTokenScope) parse() (accessTokenScopeBitmap, error) {
 | 
			
		|||
			remainingScopes = remainingScopes[i+1:]
 | 
			
		||||
		}
 | 
			
		||||
		singleScope := AccessTokenScope(v)
 | 
			
		||||
		if singleScope == "" {
 | 
			
		||||
		if singleScope == "" || singleScope == "sudo" {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		if singleScope == AccessTokenScopeAll {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,7 +20,7 @@ func TestAccessTokenScope_Normalize(t *testing.T) {
 | 
			
		|||
	tests := []scopeTestNormalize{
 | 
			
		||||
		{"", "", nil},
 | 
			
		||||
		{"write:misc,write:notification,read:package,write:notification,public-only", "public-only,write:misc,write:notification,read:package", nil},
 | 
			
		||||
		{"all", "all", nil},
 | 
			
		||||
		{"all,sudo", "all", nil},
 | 
			
		||||
		{"write:activitypub,write:admin,write:misc,write:notification,write:organization,write:package,write:issue,write:repository,write:user", "all", nil},
 | 
			
		||||
		{"write:activitypub,write:admin,write:misc,write:notification,write:organization,write:package,write:issue,write:repository,write:user,public-only", "public-only,all", nil},
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue