feat(ops-auth): add scoped API token auth across ops endpoints
This commit is contained in:
@@ -136,6 +136,9 @@ const setupHandler = (options: {
|
||||
const opsServerRef: any = {
|
||||
typedrouter,
|
||||
adminHandler: {
|
||||
validateIdentity: async (identity: interfaces.data.IIdentity) => options.isAdmin
|
||||
? { ...identity, role: 'admin' }
|
||||
: identity,
|
||||
adminIdentityGuard: {
|
||||
exec: async () => Boolean(options.isAdmin),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user