(
executorFor: (tenant: string) => Effect.Effect<Executor>,
authorize: (
headers: AdminUsersHeaders,
) => Effect.Effect<string, AdminUsersUnauthorized | AdminUsersForbidden>,
directory?: AdminIdentityDirectory | AdminUserDirectory,
)
| 216 | * member. |
| 217 | */ |
| 218 | const stubProvider = ( |
| 219 | executorFor: (tenant: string) => Effect.Effect<Executor>, |
| 220 | authorize: ( |
| 221 | headers: AdminUsersHeaders, |
| 222 | ) => Effect.Effect<string, AdminUsersUnauthorized | AdminUsersForbidden>, |
| 223 | directory?: AdminIdentityDirectory | AdminUserDirectory, |
| 224 | ) => |
| 225 | Layer.succeed(AdminUsersProvider)({ |
| 226 | listUsers: (headers, options) => |
| 227 | authorize(headers).pipe( |
| 228 | Effect.flatMap(executorFor), |
| 229 | Effect.flatMap((executor) => |
| 230 | platformViewOf(executor).pipe( |
| 231 | Effect.flatMap((admin) => listUsers(admin, options, directory)), |
| 232 | ), |
| 233 | ), |
| 234 | ), |
| 235 | listUsersWithConnections: (headers, options) => |
| 236 | authorize(headers).pipe( |
| 237 | Effect.flatMap(executorFor), |
| 238 | Effect.flatMap((executor) => |
| 239 | platformViewOf(executor).pipe( |
| 240 | Effect.flatMap((admin) => listUsersWithConnections(admin, options, directory)), |
| 241 | ), |
| 242 | ), |
| 243 | ), |
| 244 | listUserConnections: (headers, externalId) => |
| 245 | authorize(headers).pipe( |
| 246 | Effect.flatMap(executorFor), |
| 247 | Effect.flatMap((executor) => |
| 248 | platformViewOf(executor).pipe( |
| 249 | Effect.flatMap((admin) => listUserConnections(admin, externalId)), |
| 250 | ), |
| 251 | ), |
| 252 | ), |
| 253 | getUser: (headers, identifier) => |
| 254 | authorize(headers).pipe( |
| 255 | Effect.flatMap(executorFor), |
| 256 | Effect.flatMap((executor) => |
| 257 | platformViewOf(executor).pipe( |
| 258 | Effect.flatMap((admin) => getUser(admin, identifier, directory)), |
| 259 | ), |
| 260 | ), |
| 261 | ), |
| 262 | }); |
| 263 | |
| 264 | /** |
| 265 | * The authorization the hosts implement, reduced to its decision table: |
no test coverage detected