@contember/engine-tenant-api 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/model/authorization/PermissionActions.d.ts +5 -0
- package/dist/src/model/authorization/PermissionActions.d.ts.map +1 -1
- package/dist/src/model/authorization/PermissionActions.js +1 -0
- package/dist/src/model/authorization/PermissionActions.js.map +1 -1
- package/dist/src/model/authorization/PermissionsFactory.d.ts.map +1 -1
- package/dist/src/model/authorization/PermissionsFactory.js +1 -0
- package/dist/src/model/authorization/PermissionsFactory.js.map +1 -1
- package/dist/src/resolvers/query/IDPQueryResolver.d.ts.map +1 -1
- package/dist/src/resolvers/query/IDPQueryResolver.js +4 -0
- package/dist/src/resolvers/query/IDPQueryResolver.js.map +1 -1
- package/dist/src/tsconfig.tsbuildinfo +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/src/model/authorization/PermissionActions.ts +1 -0
- package/src/model/authorization/PermissionsFactory.ts +1 -0
- package/src/resolvers/query/IDPQueryResolver.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/engine-tenant-api",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"typings": "dist/src/index.d.ts",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
"test": "vitest --dir ./tests/cases --no-threads"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@contember/authorization": "1.3.
|
|
17
|
-
"@contember/config-loader": "1.3.
|
|
18
|
-
"@contember/database": "1.3.
|
|
19
|
-
"@contember/database-migrations": "1.3.
|
|
20
|
-
"@contember/dic": "1.3.
|
|
21
|
-
"@contember/graphql-utils": "1.3.
|
|
22
|
-
"@contember/logger": "1.3.
|
|
23
|
-
"@contember/schema": "1.3.
|
|
24
|
-
"@contember/schema-utils": "1.3.
|
|
25
|
-
"@contember/typesafe": "1.3.
|
|
16
|
+
"@contember/authorization": "1.3.2",
|
|
17
|
+
"@contember/config-loader": "1.3.2",
|
|
18
|
+
"@contember/database": "1.3.2",
|
|
19
|
+
"@contember/database-migrations": "1.3.2",
|
|
20
|
+
"@contember/dic": "1.3.2",
|
|
21
|
+
"@contember/graphql-utils": "1.3.2",
|
|
22
|
+
"@contember/logger": "1.3.2",
|
|
23
|
+
"@contember/schema": "1.3.2",
|
|
24
|
+
"@contember/schema-utils": "1.3.2",
|
|
25
|
+
"@contember/typesafe": "1.3.2",
|
|
26
26
|
"@graphql-tools/utils": "^8.6.13",
|
|
27
27
|
"graphql-tag": "^2.12.5",
|
|
28
28
|
"jose": "^4.10",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"otpauth": "^7.0.6"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@contember/database-tester": "1.3.
|
|
35
|
+
"@contember/database-tester": "1.3.2",
|
|
36
36
|
"@graphql-codegen/cli": "^2.6.2",
|
|
37
37
|
"@graphql-codegen/typescript": "^2.5.1",
|
|
38
38
|
"@graphql-codegen/typescript-operations": "^2.4.2",
|
|
@@ -57,6 +57,7 @@ namespace PermissionActions {
|
|
|
57
57
|
export const IDP_UPDATE = Authorizator.createAction(Resources.idp, 'update')
|
|
58
58
|
export const IDP_DISABLE = Authorizator.createAction(Resources.idp, 'disable')
|
|
59
59
|
export const IDP_ENABLE = Authorizator.createAction(Resources.idp, 'enable')
|
|
60
|
+
export const IDP_LIST = Authorizator.createAction(Resources.idp, 'list')
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
export { PermissionActions }
|
|
@@ -57,6 +57,7 @@ class PermissionsFactory {
|
|
|
57
57
|
permissions.allow(TenantRole.PROJECT_ADMIN, PermissionActions.IDP_UPDATE)
|
|
58
58
|
permissions.allow(TenantRole.PROJECT_ADMIN, PermissionActions.IDP_DISABLE)
|
|
59
59
|
permissions.allow(TenantRole.PROJECT_ADMIN, PermissionActions.IDP_ENABLE)
|
|
60
|
+
permissions.allow(TenantRole.PROJECT_ADMIN, PermissionActions.IDP_LIST)
|
|
60
61
|
|
|
61
62
|
permissions.allow(TenantRole.PROJECT_ADMIN, PermissionActions.ENTRYPOINT_DEPLOY)
|
|
62
63
|
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { IdentityProvider, QueryResolvers } from '../../schema'
|
|
2
|
-
import { IdentityProvidersQuery } from '../../model'
|
|
2
|
+
import { IdentityProvidersQuery, PermissionActions } from '../../model'
|
|
3
3
|
import { TenantResolverContext } from '../TenantResolverContext'
|
|
4
4
|
|
|
5
5
|
export class IDPQueryResolver implements QueryResolvers {
|
|
6
6
|
async identityProviders(parent: unknown, args: unknown, context: TenantResolverContext): Promise<IdentityProvider[]> {
|
|
7
|
+
await context.requireAccess({
|
|
8
|
+
action: PermissionActions.IDP_LIST,
|
|
9
|
+
message: 'You are not allowed to list IDP',
|
|
10
|
+
})
|
|
11
|
+
|
|
7
12
|
return await context.db.queryHandler.fetch(new IdentityProvidersQuery())
|
|
8
13
|
}
|
|
9
14
|
}
|