@@ -17,6 +17,7 @@ type scopeTestNormalize struct {
17
17
}
18
18
19
19
func TestAccessTokenScope_Normalize (t * testing.T ) {
20
+ assert .Equal (t , []string ([]string {"activitypub" , "admin" , "issue" , "misc" , "notification" , "organization" , "package" , "repository" , "user" }), GetAccessTokenCategories ())
20
21
tests := []scopeTestNormalize {
21
22
{"" , "" , nil },
22
23
{"write:misc,write:notification,read:package,write:notification,public-only" , "public-only,write:misc,write:notification,read:package" , nil },
@@ -25,7 +26,7 @@ func TestAccessTokenScope_Normalize(t *testing.T) {
25
26
{"write:activitypub,write:admin,write:misc,write:notification,write:organization,write:package,write:issue,write:repository,write:user,public-only" , "public-only,all" , nil },
26
27
}
27
28
28
- for _ , scope := range AllAccessTokenScopeCategoryNames {
29
+ for _ , scope := range GetAccessTokenCategories () {
29
30
tests = append (tests ,
30
31
scopeTestNormalize {AccessTokenScope (fmt .Sprintf ("read:%s" , scope )), AccessTokenScope (fmt .Sprintf ("read:%s" , scope )), nil },
31
32
scopeTestNormalize {AccessTokenScope (fmt .Sprintf ("write:%s" , scope )), AccessTokenScope (fmt .Sprintf ("write:%s" , scope )), nil },
@@ -59,7 +60,7 @@ func TestAccessTokenScope_HasScope(t *testing.T) {
59
60
{"public-only" , "read:issue" , false , nil },
60
61
}
61
62
62
- for _ , scope := range AllAccessTokenScopeCategoryNames {
63
+ for _ , scope := range GetAccessTokenCategories () {
63
64
tests = append (tests ,
64
65
scopeTestHasScope {
65
66
AccessTokenScope (fmt .Sprintf ("read:%s" , scope )),
0 commit comments