MockIamServerConfig
Axis Vertex JavaScript SDK: test
Axis Vertex JavaScript SDK: test / MockIamServerConfig
Interface: MockIamServerConfig
Mock IAM server fetch handler for testing without MSW. Intercepts permission-management endpoints and, when configured, Portal Open API M2M token/role requests.
Example
const handler = createMockIamFetch({
endpoint: 'https://auth.test.com',
rolesToPerms: { admin: ['posts:read', 'posts:write'] },
})
globalThis.fetch = handler
Properties
endpoint
endpoint:
string
portalEndpoint?
optionalportalEndpoint?:string
portalReadToken?
optionalportalReadToken?:string
portalRoles?
optionalportalRoles?:Record<string,unknown>[]
portalWriteToken?
optionalportalWriteToken?:string
rolePermissions?
optionalrolePermissions?:object[]
key
key:
string
name
name:
string
permissions
permissions:
string[]
rolesToPerms
rolesToPerms:
Record<string,string[]>