@flipdish/authorization 0.0.2-rc.1756733622 → 0.0.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/.openapi-generator/FILES +0 -1
- package/README.md +111 -1
- package/api.ts +64 -215
- package/configuration.ts +1 -1
- package/dist/api.d.ts +46 -183
- package/dist/api.js +66 -62
- package/dist/common.d.ts +1 -1
- package/dist/common.js +2 -2
- package/dist/configuration.js +1 -1
- package/package.json +2 -3
package/.openapi-generator/FILES
CHANGED
package/README.md
CHANGED
|
@@ -7,7 +7,117 @@ Internally the package utilizes the [axios](https://github.com/axios/axios) as i
|
|
|
7
7
|
### Example code
|
|
8
8
|
|
|
9
9
|
```typescript
|
|
10
|
-
import { AuthorizationApi
|
|
10
|
+
import { AuthorizationApi, Configuration, PermissionsApi, Permissions } from '@flipdish/authorization';
|
|
11
|
+
import { describe, expect, test, it } from '@jest/globals';
|
|
12
|
+
|
|
13
|
+
const basePath = "https://api.flipdish.co/auth/";
|
|
14
|
+
const configuration = new Configuration({
|
|
15
|
+
basePath,
|
|
16
|
+
// to get the API key, you should follow these docs:
|
|
17
|
+
// https://developers.flipdish.com/docs/getting-started
|
|
18
|
+
accessToken: process.env.FLIPDISH_BEARER_TOKEN_PROD,
|
|
19
|
+
// if using in a browser set useDefaultUserAgent
|
|
20
|
+
// to true to prevent errors
|
|
21
|
+
// useDefaultUserAgent: true
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const authorization = new AuthorizationApi(configuration);
|
|
25
|
+
const permissions = new PermissionsApi(configuration);
|
|
26
|
+
|
|
27
|
+
describe('Authorization Tests', () => {
|
|
28
|
+
describe('Authorization', () => {
|
|
29
|
+
|
|
30
|
+
test('List Permissions', async () => {
|
|
31
|
+
const permissionsResponse = await permissions.listPermissions();
|
|
32
|
+
expect(permissionsResponse.status).toBe(200);
|
|
33
|
+
expect(permissionsResponse.data.permissions).toBeDefined();
|
|
34
|
+
expect(permissionsResponse.data.permissions.length).toBeGreaterThan(0);
|
|
35
|
+
expect(permissionsResponse.data.permissions).toContain(Permissions.ViewApp);
|
|
36
|
+
expect(permissionsResponse.data.permissions).toContain(Permissions.CreateApp);
|
|
37
|
+
expect(permissionsResponse.data.permissions).toContain(Permissions.UpdateApp);
|
|
38
|
+
expect(permissionsResponse.data.permissions).toContain(Permissions.ViewAppName);
|
|
39
|
+
expect(permissionsResponse.data.permissions).toContain(Permissions.EditAppAssets);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
describe('Authenticate and Authorize', () => {
|
|
43
|
+
it('should authenticate and authorize with a valid FD-Authorization cookie', async () => {
|
|
44
|
+
const authorizationResponse = await authorization.authenticateAndAuthorize({
|
|
45
|
+
headers: {
|
|
46
|
+
'Cookie': `FD-Authorization=${process.env.FD_AUTH_COOKIE_PROD};`,
|
|
47
|
+
},
|
|
48
|
+
action: Permissions.AnyAuditLogs,
|
|
49
|
+
resource: {
|
|
50
|
+
id: "org12345",
|
|
51
|
+
type: "Org",
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
expect(authorizationResponse.status).toBe(200);
|
|
56
|
+
expect(authorizationResponse.data.authentication.authenticated).toBe(true);
|
|
57
|
+
expect(authorizationResponse.data.authentication.principal?.type).toBe("User");
|
|
58
|
+
expect(authorizationResponse.data.authentication.principal?.id).toBe("8147747");
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should not authenticate and authorize with an invalid FD-Authorization cookie', async () => {
|
|
62
|
+
try {
|
|
63
|
+
await authorization.authenticateAndAuthorize({
|
|
64
|
+
headers: {
|
|
65
|
+
'Cookie': `FD-Authorization=not-a-valid-cookie;`,
|
|
66
|
+
},
|
|
67
|
+
action: Permissions.AnyAuditLogs,
|
|
68
|
+
resource: {
|
|
69
|
+
id: "org12345",
|
|
70
|
+
type: "Org",
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
} catch (error: any) {
|
|
74
|
+
expect(error.response.status).toBe(401);
|
|
75
|
+
expect(error.response.data.message).toBe("Unauthenticated");
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('should authenticate and authorize with a valid Bearer token', async () => {
|
|
80
|
+
const authorizationResponse = await authorization.authenticateAndAuthorize({
|
|
81
|
+
headers: {
|
|
82
|
+
'Authorization': `Bearer ${process.env.FLIPDISH_BEARER_TOKEN_PROD}`,
|
|
83
|
+
},
|
|
84
|
+
action: Permissions.AnyAuditLogs,
|
|
85
|
+
resource: {
|
|
86
|
+
id: "org12345",
|
|
87
|
+
type: "Org",
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
expect(authorizationResponse.status).toBe(200);
|
|
92
|
+
expect(authorizationResponse.data.authentication.authenticated).toBe(true);
|
|
93
|
+
expect(authorizationResponse.data.authentication.principal?.type).toBe("User");
|
|
94
|
+
expect(authorizationResponse.data.authentication.principal?.id).toBe("8147747");
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
test('Authorize', async () => {
|
|
100
|
+
let testPrincipal: any = {
|
|
101
|
+
id: "12345",
|
|
102
|
+
type: "User",
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
let testResource: any = {
|
|
106
|
+
id: "org12345",
|
|
107
|
+
type: "Org",
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const authorizationResponse = await authorization.authorize({
|
|
111
|
+
principal: testPrincipal,
|
|
112
|
+
action: Permissions.AnyAuditLogs,
|
|
113
|
+
resource: testResource
|
|
114
|
+
});
|
|
115
|
+
expect(authorizationResponse.status).toBe(200);
|
|
116
|
+
expect(authorizationResponse.data.allowed).toBe(false);
|
|
117
|
+
expect(authorizationResponse.data.decision).toBe("DENY");
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
});
|
|
11
121
|
```
|
|
12
122
|
|
|
13
123
|
The generated Node module can be used in the following environments:
|
package/api.ts
CHANGED
|
@@ -1467,30 +1467,16 @@ export const AuthenticationApiFactory = function (configuration?: Configuration,
|
|
|
1467
1467
|
/**
|
|
1468
1468
|
* Authenticate and authorize a user to perform an action
|
|
1469
1469
|
* @summary Authenticate and authorize Request
|
|
1470
|
-
* @param {
|
|
1470
|
+
* @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
|
|
1471
1471
|
* @param {*} [options] Override http request option.
|
|
1472
1472
|
* @throws {RequiredError}
|
|
1473
1473
|
*/
|
|
1474
|
-
authenticateAndAuthorize(
|
|
1475
|
-
return localVarFp.authenticateAndAuthorize(
|
|
1474
|
+
authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthenticateAndAuthorizeResponse> {
|
|
1475
|
+
return localVarFp.authenticateAndAuthorize(authenticateAndAuthorizeRequest, options).then((request) => request(axios, basePath));
|
|
1476
1476
|
},
|
|
1477
1477
|
};
|
|
1478
1478
|
};
|
|
1479
1479
|
|
|
1480
|
-
/**
|
|
1481
|
-
* Request parameters for authenticateAndAuthorize operation in AuthenticationApi.
|
|
1482
|
-
* @export
|
|
1483
|
-
* @interface AuthenticationApiAuthenticateAndAuthorizeRequest
|
|
1484
|
-
*/
|
|
1485
|
-
export interface AuthenticationApiAuthenticateAndAuthorizeRequest {
|
|
1486
|
-
/**
|
|
1487
|
-
*
|
|
1488
|
-
* @type {AuthenticateAndAuthorizeRequest}
|
|
1489
|
-
* @memberof AuthenticationApiAuthenticateAndAuthorize
|
|
1490
|
-
*/
|
|
1491
|
-
readonly authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
1480
|
/**
|
|
1495
1481
|
* AuthenticationApi - object-oriented interface
|
|
1496
1482
|
* @export
|
|
@@ -1501,13 +1487,13 @@ export class AuthenticationApi extends BaseAPI {
|
|
|
1501
1487
|
/**
|
|
1502
1488
|
* Authenticate and authorize a user to perform an action
|
|
1503
1489
|
* @summary Authenticate and authorize Request
|
|
1504
|
-
* @param {
|
|
1490
|
+
* @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
|
|
1505
1491
|
* @param {*} [options] Override http request option.
|
|
1506
1492
|
* @throws {RequiredError}
|
|
1507
1493
|
* @memberof AuthenticationApi
|
|
1508
1494
|
*/
|
|
1509
|
-
public authenticateAndAuthorize(
|
|
1510
|
-
return AuthenticationApiFp(this.configuration).authenticateAndAuthorize(
|
|
1495
|
+
public authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig) {
|
|
1496
|
+
return AuthenticationApiFp(this.configuration).authenticateAndAuthorize(authenticateAndAuthorizeRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1511
1497
|
}
|
|
1512
1498
|
}
|
|
1513
1499
|
|
|
@@ -1642,54 +1628,26 @@ export const AuthorizationApiFactory = function (configuration?: Configuration,
|
|
|
1642
1628
|
/**
|
|
1643
1629
|
* Authenticate and authorize a user to perform an action
|
|
1644
1630
|
* @summary Authenticate and authorize Request
|
|
1645
|
-
* @param {
|
|
1631
|
+
* @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
|
|
1646
1632
|
* @param {*} [options] Override http request option.
|
|
1647
1633
|
* @throws {RequiredError}
|
|
1648
1634
|
*/
|
|
1649
|
-
authenticateAndAuthorize(
|
|
1650
|
-
return localVarFp.authenticateAndAuthorize(
|
|
1635
|
+
authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthenticateAndAuthorizeResponse> {
|
|
1636
|
+
return localVarFp.authenticateAndAuthorize(authenticateAndAuthorizeRequest, options).then((request) => request(axios, basePath));
|
|
1651
1637
|
},
|
|
1652
1638
|
/**
|
|
1653
1639
|
* Check if a user is authorized to perform an action
|
|
1654
1640
|
* @summary Authorize Request
|
|
1655
|
-
* @param {
|
|
1641
|
+
* @param {AuthorizationRequest} [authorizationRequest]
|
|
1656
1642
|
* @param {*} [options] Override http request option.
|
|
1657
1643
|
* @throws {RequiredError}
|
|
1658
1644
|
*/
|
|
1659
|
-
authorize(
|
|
1660
|
-
return localVarFp.authorize(
|
|
1645
|
+
authorize(authorizationRequest?: AuthorizationRequest, options?: RawAxiosRequestConfig): AxiosPromise<AuthorizationResponse> {
|
|
1646
|
+
return localVarFp.authorize(authorizationRequest, options).then((request) => request(axios, basePath));
|
|
1661
1647
|
},
|
|
1662
1648
|
};
|
|
1663
1649
|
};
|
|
1664
1650
|
|
|
1665
|
-
/**
|
|
1666
|
-
* Request parameters for authenticateAndAuthorize operation in AuthorizationApi.
|
|
1667
|
-
* @export
|
|
1668
|
-
* @interface AuthorizationApiAuthenticateAndAuthorizeRequest
|
|
1669
|
-
*/
|
|
1670
|
-
export interface AuthorizationApiAuthenticateAndAuthorizeRequest {
|
|
1671
|
-
/**
|
|
1672
|
-
*
|
|
1673
|
-
* @type {AuthenticateAndAuthorizeRequest}
|
|
1674
|
-
* @memberof AuthorizationApiAuthenticateAndAuthorize
|
|
1675
|
-
*/
|
|
1676
|
-
readonly authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
|
-
/**
|
|
1680
|
-
* Request parameters for authorize operation in AuthorizationApi.
|
|
1681
|
-
* @export
|
|
1682
|
-
* @interface AuthorizationApiAuthorizeRequest
|
|
1683
|
-
*/
|
|
1684
|
-
export interface AuthorizationApiAuthorizeRequest {
|
|
1685
|
-
/**
|
|
1686
|
-
*
|
|
1687
|
-
* @type {AuthorizationRequest}
|
|
1688
|
-
* @memberof AuthorizationApiAuthorize
|
|
1689
|
-
*/
|
|
1690
|
-
readonly authorizationRequest?: AuthorizationRequest
|
|
1691
|
-
}
|
|
1692
|
-
|
|
1693
1651
|
/**
|
|
1694
1652
|
* AuthorizationApi - object-oriented interface
|
|
1695
1653
|
* @export
|
|
@@ -1700,25 +1658,25 @@ export class AuthorizationApi extends BaseAPI {
|
|
|
1700
1658
|
/**
|
|
1701
1659
|
* Authenticate and authorize a user to perform an action
|
|
1702
1660
|
* @summary Authenticate and authorize Request
|
|
1703
|
-
* @param {
|
|
1661
|
+
* @param {AuthenticateAndAuthorizeRequest} [authenticateAndAuthorizeRequest]
|
|
1704
1662
|
* @param {*} [options] Override http request option.
|
|
1705
1663
|
* @throws {RequiredError}
|
|
1706
1664
|
* @memberof AuthorizationApi
|
|
1707
1665
|
*/
|
|
1708
|
-
public authenticateAndAuthorize(
|
|
1709
|
-
return AuthorizationApiFp(this.configuration).authenticateAndAuthorize(
|
|
1666
|
+
public authenticateAndAuthorize(authenticateAndAuthorizeRequest?: AuthenticateAndAuthorizeRequest, options?: RawAxiosRequestConfig) {
|
|
1667
|
+
return AuthorizationApiFp(this.configuration).authenticateAndAuthorize(authenticateAndAuthorizeRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1710
1668
|
}
|
|
1711
1669
|
|
|
1712
1670
|
/**
|
|
1713
1671
|
* Check if a user is authorized to perform an action
|
|
1714
1672
|
* @summary Authorize Request
|
|
1715
|
-
* @param {
|
|
1673
|
+
* @param {AuthorizationRequest} [authorizationRequest]
|
|
1716
1674
|
* @param {*} [options] Override http request option.
|
|
1717
1675
|
* @throws {RequiredError}
|
|
1718
1676
|
* @memberof AuthorizationApi
|
|
1719
1677
|
*/
|
|
1720
|
-
public authorize(
|
|
1721
|
-
return AuthorizationApiFp(this.configuration).authorize(
|
|
1678
|
+
public authorize(authorizationRequest?: AuthorizationRequest, options?: RawAxiosRequestConfig) {
|
|
1679
|
+
return AuthorizationApiFp(this.configuration).authorize(authorizationRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1722
1680
|
}
|
|
1723
1681
|
}
|
|
1724
1682
|
|
|
@@ -2077,130 +2035,50 @@ export const RoleAssignmentApiFactory = function (configuration?: Configuration,
|
|
|
2077
2035
|
/**
|
|
2078
2036
|
* Assigns a specified role to a given principal (user, group, etc.)
|
|
2079
2037
|
* @summary Assign Role to Principal
|
|
2080
|
-
* @param {
|
|
2038
|
+
* @param {string} orgId
|
|
2039
|
+
* @param {AssignRoleRequestBody} [assignRoleRequestBody]
|
|
2081
2040
|
* @param {*} [options] Override http request option.
|
|
2082
2041
|
* @throws {RequiredError}
|
|
2083
2042
|
*/
|
|
2084
|
-
assignRoleToPrincipal(
|
|
2085
|
-
return localVarFp.assignRoleToPrincipal(
|
|
2043
|
+
assignRoleToPrincipal(orgId: string, assignRoleRequestBody?: AssignRoleRequestBody, options?: RawAxiosRequestConfig): AxiosPromise<AssignRoleSuccessResponse> {
|
|
2044
|
+
return localVarFp.assignRoleToPrincipal(orgId, assignRoleRequestBody, options).then((request) => request(axios, basePath));
|
|
2086
2045
|
},
|
|
2087
2046
|
/**
|
|
2088
2047
|
* Get the active roles for a given principal
|
|
2089
2048
|
* @summary Get Principal Roles
|
|
2090
|
-
* @param {
|
|
2049
|
+
* @param {string} orgId
|
|
2050
|
+
* @param {GetPrincipalRolesRequestBody} [getPrincipalRolesRequestBody]
|
|
2091
2051
|
* @param {*} [options] Override http request option.
|
|
2092
2052
|
* @throws {RequiredError}
|
|
2093
2053
|
*/
|
|
2094
|
-
getPrincipalRoles(
|
|
2095
|
-
return localVarFp.getPrincipalRoles(
|
|
2054
|
+
getPrincipalRoles(orgId: string, getPrincipalRolesRequestBody?: GetPrincipalRolesRequestBody, options?: RawAxiosRequestConfig): AxiosPromise<GetPrincipalRolesSuccessResponse> {
|
|
2055
|
+
return localVarFp.getPrincipalRoles(orgId, getPrincipalRolesRequestBody, options).then((request) => request(axios, basePath));
|
|
2096
2056
|
},
|
|
2097
2057
|
/**
|
|
2098
2058
|
* Revokes a forbidden role from a given principal (user, group, etc.)
|
|
2099
2059
|
* @summary Revoke Forbidden Role from Principal
|
|
2100
|
-
* @param {
|
|
2060
|
+
* @param {string} orgId
|
|
2061
|
+
* @param {RevokeForbiddenRoleRequestBody} [revokeForbiddenRoleRequestBody]
|
|
2101
2062
|
* @param {*} [options] Override http request option.
|
|
2102
2063
|
* @throws {RequiredError}
|
|
2103
2064
|
*/
|
|
2104
|
-
revokeForbiddenRoleFromPrincipal(
|
|
2105
|
-
return localVarFp.revokeForbiddenRoleFromPrincipal(
|
|
2065
|
+
revokeForbiddenRoleFromPrincipal(orgId: string, revokeForbiddenRoleRequestBody?: RevokeForbiddenRoleRequestBody, options?: RawAxiosRequestConfig): AxiosPromise<RevokeRoleSuccessResponse> {
|
|
2066
|
+
return localVarFp.revokeForbiddenRoleFromPrincipal(orgId, revokeForbiddenRoleRequestBody, options).then((request) => request(axios, basePath));
|
|
2106
2067
|
},
|
|
2107
2068
|
/**
|
|
2108
2069
|
* Revokes a specified role from a given principal (user, group, etc.)
|
|
2109
2070
|
* @summary Revoke Role from Principal
|
|
2110
|
-
* @param {
|
|
2071
|
+
* @param {string} orgId
|
|
2072
|
+
* @param {RevokeRoleRequestBody} [revokeRoleRequestBody]
|
|
2111
2073
|
* @param {*} [options] Override http request option.
|
|
2112
2074
|
* @throws {RequiredError}
|
|
2113
2075
|
*/
|
|
2114
|
-
revokeRoleFromPrincipal(
|
|
2115
|
-
return localVarFp.revokeRoleFromPrincipal(
|
|
2076
|
+
revokeRoleFromPrincipal(orgId: string, revokeRoleRequestBody?: RevokeRoleRequestBody, options?: RawAxiosRequestConfig): AxiosPromise<RevokeRoleSuccessResponse> {
|
|
2077
|
+
return localVarFp.revokeRoleFromPrincipal(orgId, revokeRoleRequestBody, options).then((request) => request(axios, basePath));
|
|
2116
2078
|
},
|
|
2117
2079
|
};
|
|
2118
2080
|
};
|
|
2119
2081
|
|
|
2120
|
-
/**
|
|
2121
|
-
* Request parameters for assignRoleToPrincipal operation in RoleAssignmentApi.
|
|
2122
|
-
* @export
|
|
2123
|
-
* @interface RoleAssignmentApiAssignRoleToPrincipalRequest
|
|
2124
|
-
*/
|
|
2125
|
-
export interface RoleAssignmentApiAssignRoleToPrincipalRequest {
|
|
2126
|
-
/**
|
|
2127
|
-
*
|
|
2128
|
-
* @type {string}
|
|
2129
|
-
* @memberof RoleAssignmentApiAssignRoleToPrincipal
|
|
2130
|
-
*/
|
|
2131
|
-
readonly orgId: string
|
|
2132
|
-
|
|
2133
|
-
/**
|
|
2134
|
-
*
|
|
2135
|
-
* @type {AssignRoleRequestBody}
|
|
2136
|
-
* @memberof RoleAssignmentApiAssignRoleToPrincipal
|
|
2137
|
-
*/
|
|
2138
|
-
readonly assignRoleRequestBody?: AssignRoleRequestBody
|
|
2139
|
-
}
|
|
2140
|
-
|
|
2141
|
-
/**
|
|
2142
|
-
* Request parameters for getPrincipalRoles operation in RoleAssignmentApi.
|
|
2143
|
-
* @export
|
|
2144
|
-
* @interface RoleAssignmentApiGetPrincipalRolesRequest
|
|
2145
|
-
*/
|
|
2146
|
-
export interface RoleAssignmentApiGetPrincipalRolesRequest {
|
|
2147
|
-
/**
|
|
2148
|
-
*
|
|
2149
|
-
* @type {string}
|
|
2150
|
-
* @memberof RoleAssignmentApiGetPrincipalRoles
|
|
2151
|
-
*/
|
|
2152
|
-
readonly orgId: string
|
|
2153
|
-
|
|
2154
|
-
/**
|
|
2155
|
-
*
|
|
2156
|
-
* @type {GetPrincipalRolesRequestBody}
|
|
2157
|
-
* @memberof RoleAssignmentApiGetPrincipalRoles
|
|
2158
|
-
*/
|
|
2159
|
-
readonly getPrincipalRolesRequestBody?: GetPrincipalRolesRequestBody
|
|
2160
|
-
}
|
|
2161
|
-
|
|
2162
|
-
/**
|
|
2163
|
-
* Request parameters for revokeForbiddenRoleFromPrincipal operation in RoleAssignmentApi.
|
|
2164
|
-
* @export
|
|
2165
|
-
* @interface RoleAssignmentApiRevokeForbiddenRoleFromPrincipalRequest
|
|
2166
|
-
*/
|
|
2167
|
-
export interface RoleAssignmentApiRevokeForbiddenRoleFromPrincipalRequest {
|
|
2168
|
-
/**
|
|
2169
|
-
*
|
|
2170
|
-
* @type {string}
|
|
2171
|
-
* @memberof RoleAssignmentApiRevokeForbiddenRoleFromPrincipal
|
|
2172
|
-
*/
|
|
2173
|
-
readonly orgId: string
|
|
2174
|
-
|
|
2175
|
-
/**
|
|
2176
|
-
*
|
|
2177
|
-
* @type {RevokeForbiddenRoleRequestBody}
|
|
2178
|
-
* @memberof RoleAssignmentApiRevokeForbiddenRoleFromPrincipal
|
|
2179
|
-
*/
|
|
2180
|
-
readonly revokeForbiddenRoleRequestBody?: RevokeForbiddenRoleRequestBody
|
|
2181
|
-
}
|
|
2182
|
-
|
|
2183
|
-
/**
|
|
2184
|
-
* Request parameters for revokeRoleFromPrincipal operation in RoleAssignmentApi.
|
|
2185
|
-
* @export
|
|
2186
|
-
* @interface RoleAssignmentApiRevokeRoleFromPrincipalRequest
|
|
2187
|
-
*/
|
|
2188
|
-
export interface RoleAssignmentApiRevokeRoleFromPrincipalRequest {
|
|
2189
|
-
/**
|
|
2190
|
-
*
|
|
2191
|
-
* @type {string}
|
|
2192
|
-
* @memberof RoleAssignmentApiRevokeRoleFromPrincipal
|
|
2193
|
-
*/
|
|
2194
|
-
readonly orgId: string
|
|
2195
|
-
|
|
2196
|
-
/**
|
|
2197
|
-
*
|
|
2198
|
-
* @type {RevokeRoleRequestBody}
|
|
2199
|
-
* @memberof RoleAssignmentApiRevokeRoleFromPrincipal
|
|
2200
|
-
*/
|
|
2201
|
-
readonly revokeRoleRequestBody?: RevokeRoleRequestBody
|
|
2202
|
-
}
|
|
2203
|
-
|
|
2204
2082
|
/**
|
|
2205
2083
|
* RoleAssignmentApi - object-oriented interface
|
|
2206
2084
|
* @export
|
|
@@ -2211,49 +2089,53 @@ export class RoleAssignmentApi extends BaseAPI {
|
|
|
2211
2089
|
/**
|
|
2212
2090
|
* Assigns a specified role to a given principal (user, group, etc.)
|
|
2213
2091
|
* @summary Assign Role to Principal
|
|
2214
|
-
* @param {
|
|
2092
|
+
* @param {string} orgId
|
|
2093
|
+
* @param {AssignRoleRequestBody} [assignRoleRequestBody]
|
|
2215
2094
|
* @param {*} [options] Override http request option.
|
|
2216
2095
|
* @throws {RequiredError}
|
|
2217
2096
|
* @memberof RoleAssignmentApi
|
|
2218
2097
|
*/
|
|
2219
|
-
public assignRoleToPrincipal(
|
|
2220
|
-
return RoleAssignmentApiFp(this.configuration).assignRoleToPrincipal(
|
|
2098
|
+
public assignRoleToPrincipal(orgId: string, assignRoleRequestBody?: AssignRoleRequestBody, options?: RawAxiosRequestConfig) {
|
|
2099
|
+
return RoleAssignmentApiFp(this.configuration).assignRoleToPrincipal(orgId, assignRoleRequestBody, options).then((request) => request(this.axios, this.basePath));
|
|
2221
2100
|
}
|
|
2222
2101
|
|
|
2223
2102
|
/**
|
|
2224
2103
|
* Get the active roles for a given principal
|
|
2225
2104
|
* @summary Get Principal Roles
|
|
2226
|
-
* @param {
|
|
2105
|
+
* @param {string} orgId
|
|
2106
|
+
* @param {GetPrincipalRolesRequestBody} [getPrincipalRolesRequestBody]
|
|
2227
2107
|
* @param {*} [options] Override http request option.
|
|
2228
2108
|
* @throws {RequiredError}
|
|
2229
2109
|
* @memberof RoleAssignmentApi
|
|
2230
2110
|
*/
|
|
2231
|
-
public getPrincipalRoles(
|
|
2232
|
-
return RoleAssignmentApiFp(this.configuration).getPrincipalRoles(
|
|
2111
|
+
public getPrincipalRoles(orgId: string, getPrincipalRolesRequestBody?: GetPrincipalRolesRequestBody, options?: RawAxiosRequestConfig) {
|
|
2112
|
+
return RoleAssignmentApiFp(this.configuration).getPrincipalRoles(orgId, getPrincipalRolesRequestBody, options).then((request) => request(this.axios, this.basePath));
|
|
2233
2113
|
}
|
|
2234
2114
|
|
|
2235
2115
|
/**
|
|
2236
2116
|
* Revokes a forbidden role from a given principal (user, group, etc.)
|
|
2237
2117
|
* @summary Revoke Forbidden Role from Principal
|
|
2238
|
-
* @param {
|
|
2118
|
+
* @param {string} orgId
|
|
2119
|
+
* @param {RevokeForbiddenRoleRequestBody} [revokeForbiddenRoleRequestBody]
|
|
2239
2120
|
* @param {*} [options] Override http request option.
|
|
2240
2121
|
* @throws {RequiredError}
|
|
2241
2122
|
* @memberof RoleAssignmentApi
|
|
2242
2123
|
*/
|
|
2243
|
-
public revokeForbiddenRoleFromPrincipal(
|
|
2244
|
-
return RoleAssignmentApiFp(this.configuration).revokeForbiddenRoleFromPrincipal(
|
|
2124
|
+
public revokeForbiddenRoleFromPrincipal(orgId: string, revokeForbiddenRoleRequestBody?: RevokeForbiddenRoleRequestBody, options?: RawAxiosRequestConfig) {
|
|
2125
|
+
return RoleAssignmentApiFp(this.configuration).revokeForbiddenRoleFromPrincipal(orgId, revokeForbiddenRoleRequestBody, options).then((request) => request(this.axios, this.basePath));
|
|
2245
2126
|
}
|
|
2246
2127
|
|
|
2247
2128
|
/**
|
|
2248
2129
|
* Revokes a specified role from a given principal (user, group, etc.)
|
|
2249
2130
|
* @summary Revoke Role from Principal
|
|
2250
|
-
* @param {
|
|
2131
|
+
* @param {string} orgId
|
|
2132
|
+
* @param {RevokeRoleRequestBody} [revokeRoleRequestBody]
|
|
2251
2133
|
* @param {*} [options] Override http request option.
|
|
2252
2134
|
* @throws {RequiredError}
|
|
2253
2135
|
* @memberof RoleAssignmentApi
|
|
2254
2136
|
*/
|
|
2255
|
-
public revokeRoleFromPrincipal(
|
|
2256
|
-
return RoleAssignmentApiFp(this.configuration).revokeRoleFromPrincipal(
|
|
2137
|
+
public revokeRoleFromPrincipal(orgId: string, revokeRoleRequestBody?: RevokeRoleRequestBody, options?: RawAxiosRequestConfig) {
|
|
2138
|
+
return RoleAssignmentApiFp(this.configuration).revokeRoleFromPrincipal(orgId, revokeRoleRequestBody, options).then((request) => request(this.axios, this.basePath));
|
|
2257
2139
|
}
|
|
2258
2140
|
}
|
|
2259
2141
|
|
|
@@ -2393,61 +2275,27 @@ export const UserPermissionsApiFactory = function (configuration?: Configuration
|
|
|
2393
2275
|
/**
|
|
2394
2276
|
* List the available permissions for the current user
|
|
2395
2277
|
* @summary List Own Permissions
|
|
2396
|
-
* @param {
|
|
2278
|
+
* @param {string} orgId
|
|
2397
2279
|
* @param {*} [options] Override http request option.
|
|
2398
2280
|
* @throws {RequiredError}
|
|
2399
2281
|
*/
|
|
2400
|
-
listOwnPermissions(
|
|
2401
|
-
return localVarFp.listOwnPermissions(
|
|
2282
|
+
listOwnPermissions(orgId: string, options?: RawAxiosRequestConfig): AxiosPromise<GetUserPermissionsSuccessResponse> {
|
|
2283
|
+
return localVarFp.listOwnPermissions(orgId, options).then((request) => request(axios, basePath));
|
|
2402
2284
|
},
|
|
2403
2285
|
/**
|
|
2404
2286
|
* List the available permissions for a given user
|
|
2405
2287
|
* @summary List User Permissions
|
|
2406
|
-
* @param {
|
|
2288
|
+
* @param {string} orgId
|
|
2289
|
+
* @param {string} userId
|
|
2407
2290
|
* @param {*} [options] Override http request option.
|
|
2408
2291
|
* @throws {RequiredError}
|
|
2409
2292
|
*/
|
|
2410
|
-
listUserPermissions(
|
|
2411
|
-
return localVarFp.listUserPermissions(
|
|
2293
|
+
listUserPermissions(orgId: string, userId: string, options?: RawAxiosRequestConfig): AxiosPromise<GetUserPermissionsSuccessResponse> {
|
|
2294
|
+
return localVarFp.listUserPermissions(orgId, userId, options).then((request) => request(axios, basePath));
|
|
2412
2295
|
},
|
|
2413
2296
|
};
|
|
2414
2297
|
};
|
|
2415
2298
|
|
|
2416
|
-
/**
|
|
2417
|
-
* Request parameters for listOwnPermissions operation in UserPermissionsApi.
|
|
2418
|
-
* @export
|
|
2419
|
-
* @interface UserPermissionsApiListOwnPermissionsRequest
|
|
2420
|
-
*/
|
|
2421
|
-
export interface UserPermissionsApiListOwnPermissionsRequest {
|
|
2422
|
-
/**
|
|
2423
|
-
*
|
|
2424
|
-
* @type {string}
|
|
2425
|
-
* @memberof UserPermissionsApiListOwnPermissions
|
|
2426
|
-
*/
|
|
2427
|
-
readonly orgId: string
|
|
2428
|
-
}
|
|
2429
|
-
|
|
2430
|
-
/**
|
|
2431
|
-
* Request parameters for listUserPermissions operation in UserPermissionsApi.
|
|
2432
|
-
* @export
|
|
2433
|
-
* @interface UserPermissionsApiListUserPermissionsRequest
|
|
2434
|
-
*/
|
|
2435
|
-
export interface UserPermissionsApiListUserPermissionsRequest {
|
|
2436
|
-
/**
|
|
2437
|
-
*
|
|
2438
|
-
* @type {string}
|
|
2439
|
-
* @memberof UserPermissionsApiListUserPermissions
|
|
2440
|
-
*/
|
|
2441
|
-
readonly orgId: string
|
|
2442
|
-
|
|
2443
|
-
/**
|
|
2444
|
-
*
|
|
2445
|
-
* @type {string}
|
|
2446
|
-
* @memberof UserPermissionsApiListUserPermissions
|
|
2447
|
-
*/
|
|
2448
|
-
readonly userId: string
|
|
2449
|
-
}
|
|
2450
|
-
|
|
2451
2299
|
/**
|
|
2452
2300
|
* UserPermissionsApi - object-oriented interface
|
|
2453
2301
|
* @export
|
|
@@ -2458,25 +2306,26 @@ export class UserPermissionsApi extends BaseAPI {
|
|
|
2458
2306
|
/**
|
|
2459
2307
|
* List the available permissions for the current user
|
|
2460
2308
|
* @summary List Own Permissions
|
|
2461
|
-
* @param {
|
|
2309
|
+
* @param {string} orgId
|
|
2462
2310
|
* @param {*} [options] Override http request option.
|
|
2463
2311
|
* @throws {RequiredError}
|
|
2464
2312
|
* @memberof UserPermissionsApi
|
|
2465
2313
|
*/
|
|
2466
|
-
public listOwnPermissions(
|
|
2467
|
-
return UserPermissionsApiFp(this.configuration).listOwnPermissions(
|
|
2314
|
+
public listOwnPermissions(orgId: string, options?: RawAxiosRequestConfig) {
|
|
2315
|
+
return UserPermissionsApiFp(this.configuration).listOwnPermissions(orgId, options).then((request) => request(this.axios, this.basePath));
|
|
2468
2316
|
}
|
|
2469
2317
|
|
|
2470
2318
|
/**
|
|
2471
2319
|
* List the available permissions for a given user
|
|
2472
2320
|
* @summary List User Permissions
|
|
2473
|
-
* @param {
|
|
2321
|
+
* @param {string} orgId
|
|
2322
|
+
* @param {string} userId
|
|
2474
2323
|
* @param {*} [options] Override http request option.
|
|
2475
2324
|
* @throws {RequiredError}
|
|
2476
2325
|
* @memberof UserPermissionsApi
|
|
2477
2326
|
*/
|
|
2478
|
-
public listUserPermissions(
|
|
2479
|
-
return UserPermissionsApiFp(this.configuration).listUserPermissions(
|
|
2327
|
+
public listUserPermissions(orgId: string, userId: string, options?: RawAxiosRequestConfig) {
|
|
2328
|
+
return UserPermissionsApiFp(this.configuration).listUserPermissions(orgId, userId, options).then((request) => request(this.axios, this.basePath));
|
|
2480
2329
|
}
|
|
2481
2330
|
}
|
|
2482
2331
|
|
package/configuration.ts
CHANGED
|
@@ -100,7 +100,7 @@ export class Configuration {
|
|
|
100
100
|
|
|
101
101
|
const extraHeaders = param.useDefaultUserAgent ? {} : {
|
|
102
102
|
headers: {
|
|
103
|
-
"user-agent": "Flipdish authorization typescript SDK / 0.0.2
|
|
103
|
+
"user-agent": "Flipdish authorization typescript SDK / 0.0.2"
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
|