@@ -2171,92 +2171,6 @@ public async Task TestCustomHttp()
2171
2171
Assert . AreEqual ( faunaEndpoint , myHttpClient . LastMessage . RequestUri . ToString ( ) ) ;
2172
2172
}
2173
2173
2174
- [ Test ]
2175
- public async Task TestAuthProviders ( )
2176
- {
2177
- string roleName = RandomStartingWith ( "role_" ) ;
2178
- string accessProviderName = RandomStartingWith ( "access_prov_" ) ;
2179
- string issuerName = RandomStartingWith ( "issuer_" ) ;
2180
- string jwksUri = "https://xxxx.auth0.com/" ;
2181
-
2182
- RefV collection = await RandomCollection ( ) ;
2183
-
2184
- RefV role = GetRef ( await adminClient . Query ( CreateRole ( Obj (
2185
- "name" , roleName ,
2186
- "privileges" , Arr ( Obj (
2187
- "resource" , collection ,
2188
- "actions" , Obj ( "read" , true )
2189
- ) )
2190
- ) ) ) ) ;
2191
-
2192
- Value accessProvider = await adminClient . Query ( CreateAccessProvider (
2193
- Obj (
2194
- "name" , accessProviderName ,
2195
- "issuer" , issuerName ,
2196
- "jwks_uri" , jwksUri ,
2197
- "allowed_collections" , Arr ( collection ) ,
2198
- "allowed_roles" , Arr ( role )
2199
- ) ) ) ;
2200
-
2201
- Assert . AreEqual (
2202
- accessProviderName ,
2203
- accessProvider . Get ( Field . At ( "name" ) ) . To < string > ( ) . Value ) ;
2204
-
2205
- Assert . AreEqual (
2206
- issuerName ,
2207
- accessProvider . Get ( Field . At ( "issuer" ) ) . To < string > ( ) . Value ) ;
2208
-
2209
- Assert . AreEqual (
2210
- "https://xxxx.auth0.com/" ,
2211
- accessProvider . Get ( Field . At ( "jwks_uri" ) ) . To < string > ( ) . Value ) ;
2212
-
2213
- Assert . AreEqual (
2214
- collection ,
2215
- accessProvider . Get ( Field . At ( "allowed_collections" ) ) . To < ArrayV > ( ) . Value . First ( ) ) ;
2216
-
2217
- Assert . AreEqual (
2218
- role ,
2219
- accessProvider . Get ( Field . At ( "allowed_roles" ) ) . To < ArrayV > ( ) . Value . First ( ) ) ;
2220
-
2221
- // Retrieving
2222
-
2223
- Value accessProviderFromDB =
2224
- await adminClient . Query ( Get ( AccessProvider ( accessProviderName ) ) ) ;
2225
-
2226
- Assert . AreEqual ( accessProvider , accessProviderFromDB ) ;
2227
- Assert . AreEqual (
2228
- jwksUri ,
2229
- accessProviderFromDB . Get ( Field . At ( "jwks_uri" ) ) . To < string > ( ) . Value ) ;
2230
-
2231
- // Retrieving: Denied
2232
-
2233
- var ex = Assert . ThrowsAsync < PermissionDenied > (
2234
- async ( ) => await client . Query ( Get ( AccessProvider ( accessProviderName ) ) )
2235
- ) ;
2236
-
2237
- AssertErrors ( ex , code : "permission denied" , description : "Insufficient privileges to perform the action." ) ;
2238
- AssertEmptyFailures ( ex ) ;
2239
- AssertPosition ( ex , positions : Is . EquivalentTo ( new List < string > { } ) ) ;
2240
-
2241
- // Paginating
2242
-
2243
- var otherName = RandomStartingWith ( "ap_" ) ;
2244
-
2245
- await adminClient . Query ( CreateAccessProvider (
2246
- Obj (
2247
- "name" , otherName ,
2248
- "issuer" , RandomStartingWith ( "ap_" ) ,
2249
- "jwks_uri" , jwksUri
2250
- ) ) ) ;
2251
-
2252
- Value page = await adminClient . Query ( Paginate ( AccessProviders ( ) ) ) ;
2253
- RefV [ ] pageData = page . Get ( DATA ) . To < RefV [ ] > ( ) . Value ;
2254
-
2255
- Assert . AreEqual ( 2 , pageData . Length ) ;
2256
- Assert . AreEqual ( accessProviderName , pageData . First ( ) . Id ) ;
2257
- Assert . AreEqual ( otherName , pageData . Last ( ) . Id ) ;
2258
- }
2259
-
2260
2174
private async Task < Value > NewCollectionWithValues ( string colName , string indexName , int size = 10 , bool indexWithAllValues = false )
2261
2175
{
2262
2176
RefV aCollection = ( await client . Query ( CreateCollection ( Obj ( "name" , colName ) ) ) )
0 commit comments