You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: policies/authorization_grant/authorization_grant_test.rego
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -78,65 +78,65 @@ test_unstable_device_scopes if {
78
78
authorization_grant.allow with input.user as user
79
79
with input.client as client
80
80
with input.grant_type as "authorization_code"
81
-
with input.scope as "urn:matrix:org.matrix.msc2967.client:device:AAbbCCdd01"
81
+
with input.scope as "urn:matrix:org.matrix.msc2967.client:api:* urn:matrix:org.matrix.msc2967.client:device:AAbbCCdd01"
82
82
83
83
authorization_grant.allow with input.user as user
84
84
with input.client as client
85
85
with input.grant_type as "authorization_code"
86
-
with input.scope as "urn:matrix:org.matrix.msc2967.client:device:AAbbCCdd01-asdasdsa1-2313"
86
+
with input.scope as "urn:matrix:org.matrix.msc2967.client:api:* urn:matrix:org.matrix.msc2967.client:device:AAbbCCdd01-asdasdsa1-2313"
87
87
88
88
# Too short
89
89
not authorization_grant.allow with input.user as user
90
90
with input.client as client
91
91
with input.grant_type as "authorization_code"
92
-
with input.scope as "urn:matrix:org.matrix.msc2967.client:device:abcd"
92
+
with input.scope as "urn:matrix:org.matrix.msc2967.client:api:* urn:matrix:org.matrix.msc2967.client:device:abcd"
93
93
94
94
# Multiple device scope
95
95
not authorization_grant.allow with input.user as user
96
96
with input.client as client
97
97
with input.grant_type as "authorization_code"
98
-
with input.scope as "urn:matrix:org.matrix.msc2967.client:device:AAbbCCdd01 urn:matrix:org.matrix.msc2967.client:device:AAbbCCdd02"
98
+
with input.scope as "urn:matrix:org.matrix.msc2967.client:api:* urn:matrix:org.matrix.msc2967.client:device:AAbbCCdd01 urn:matrix:org.matrix.msc2967.client:device:AAbbCCdd02"
99
99
100
100
# Allowed with the device code grant
101
101
authorization_grant.allow with input.user as user
102
102
with input.client as client
103
103
with input.grant_type as "urn:ietf:params:oauth:grant-type:device_code"
104
-
with input.scope as "urn:matrix:org.matrix.msc2967.client:device:AAbbCCdd01"
104
+
with input.scope as "urn:matrix:org.matrix.msc2967.client:api:* urn:matrix:org.matrix.msc2967.client:device:AAbbCCdd01"
105
105
106
106
# Not authorization_grant.allowed for the client credentials grant
107
107
not authorization_grant.allow with input.client as client
108
108
with input.grant_type as "client_credentials"
109
-
with input.scope as "urn:matrix:org.matrix.msc2967.client:device:AAbbCCdd01"
109
+
with input.scope as "urn:matrix:org.matrix.msc2967.client:api:* urn:matrix:org.matrix.msc2967.client:device:AAbbCCdd01"
110
110
}
111
111
112
112
test_stable_device_scopes if {
113
113
authorization_grant.allow with input.user as user
114
114
with input.client as client
115
115
with input.grant_type as "authorization_code"
116
-
with input.scope as "urn:matrix:client:device:AAbbCCdd01"
116
+
with input.scope as "urn:matrix:client:api:* urn:matrix:client:device:AAbbCCdd01"
117
117
118
118
authorization_grant.allow with input.user as user
119
119
with input.client as client
120
120
with input.grant_type as "authorization_code"
121
-
with input.scope as "urn:matrix:client:device:AAbbCCdd01-asdasdsa1-2313"
121
+
with input.scope as "urn:matrix:client:api:* urn:matrix:client:device:AAbbCCdd01-asdasdsa1-2313"
122
122
123
123
# Too short
124
124
not authorization_grant.allow with input.user as user
125
125
with input.client as client
126
126
with input.grant_type as "authorization_code"
127
-
with input.scope as "urn:matrix:client:device:abcd"
127
+
with input.scope as "urn:matrix:client:api:* urn:matrix:client:device:abcd"
128
128
129
129
# Multiple device scope
130
130
not authorization_grant.allow with input.user as user
131
131
with input.client as client
132
132
with input.grant_type as "authorization_code"
133
-
with input.scope as "urn:matrix:client:device:AAbbCCdd01 urn:matrix:client:device:AAbbCCdd02"
133
+
with input.scope as "urn:matrix:client:api:* urn:matrix:client:device:AAbbCCdd01 urn:matrix:client:device:AAbbCCdd02"
134
134
135
135
# Allowed with the device code grant
136
136
authorization_grant.allow with input.user as user
137
137
with input.client as client
138
138
with input.grant_type as "urn:ietf:params:oauth:grant-type:device_code"
139
-
with input.scope as "urn:matrix:client:device:AAbbCCdd01"
139
+
with input.scope as "urn:matrix:client:api:* urn:matrix:client:device:AAbbCCdd01"
140
140
141
141
# Not authorization_grant.allowed for the client credentials grant
142
142
not authorization_grant.allow with input.client as client
0 commit comments