-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from bcgov/feature/ns-tiered
Namespace summary and tiered access
- Loading branch information
Showing
150 changed files
with
7,636 additions
and
985 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,5 +112,7 @@ _tmp | |
|
||
kc.js | ||
|
||
.config | ||
|
||
# vs code settings | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const express = require('express'); | ||
const pathModule = require('path'); | ||
|
||
const { createProxyMiddleware } = require('http-proxy-middleware'); | ||
|
||
class ApiDSProxyApp { | ||
constructor({ url }) { | ||
this._url = url; | ||
} | ||
|
||
prepareMiddleware({ keystone }) { | ||
const app = express(); | ||
|
||
const apiProxy = createProxyMiddleware({ | ||
target: this._url, | ||
changeOrigin: true, | ||
pathRewrite: { '^/int/api/': '/ds/api/' }, | ||
onProxyReq: (proxyReq, req) => { | ||
proxyReq.removeHeader('cookie'); | ||
proxyReq.setHeader('Accept', 'application/json'); | ||
proxyReq.setHeader( | ||
'Authorization', | ||
`Bearer ${req.header('x-forwarded-access-token')}` | ||
); | ||
}, | ||
onError: (err, req, res, target) => { | ||
console.log('CAUGHT ERROR!'); | ||
console.log(err); | ||
res.writeHead(400, { | ||
'Content-Type': 'text/plain', | ||
}); | ||
res.end('error reaching api'); | ||
}, | ||
}); | ||
app.all(/^\/int\/api\//, apiProxy); | ||
|
||
return app; | ||
} | ||
} | ||
|
||
module.exports = { | ||
ApiDSProxyApp, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/authz/graphql-whitelist/httplocalhost3000admingraphiql-19e539.gql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
query GET_APPLICATION_SERVICES($appId: String!) { | ||
myServiceAccesses(where: { application: { appId: $appId } }) { | ||
id | ||
name | ||
active | ||
application { | ||
name | ||
} | ||
productEnvironment { | ||
id | ||
name | ||
product { | ||
name | ||
} | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/authz/graphql-whitelist/httplocalhost3000admingraphiql-70d2f3.gql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
query MyApplications { | ||
myApplications { | ||
id | ||
appId | ||
description | ||
name | ||
owner { | ||
name | ||
} | ||
} | ||
allTemporaryIdentities { | ||
id | ||
userId | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/authz/graphql-whitelist/httplocalhost3000admingraphiql-a7b31f.gql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
myApplications { | ||
id | ||
appId | ||
description | ||
name | ||
owner { | ||
name | ||
} | ||
} | ||
allTemporaryIdentities { | ||
id | ||
userId | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/authz/graphql-whitelist/httplocalhost4180managerconsumers-602067.gql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
mutation ToggleConsumerRoles( | ||
$prodEnvId: ID! | ||
$consumerUsername: String! | ||
$roleName: String! | ||
$grant: Boolean! | ||
) { | ||
updateConsumerRoleAssignment( | ||
prodEnvId: $prodEnvId | ||
consumerUsername: $consumerUsername | ||
roleName: $roleName | ||
grant: $grant | ||
) | ||
} |
29 changes: 29 additions & 0 deletions
29
src/authz/graphql-whitelist/httplocalhost4180managerconsumers-7b48ba.gql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
query GetConsumers { | ||
allServiceAccessesByNamespace( | ||
first: 200 | ||
orderBy: "updatedAt_DESC" | ||
where: { consumer: { username_not_starts_with: "sa-" } } | ||
) { | ||
namespace | ||
consumer { | ||
id | ||
username | ||
aclGroups | ||
customId | ||
plugins { | ||
name | ||
} | ||
tags | ||
updatedAt | ||
} | ||
application { | ||
name | ||
appId | ||
} | ||
} | ||
|
||
allAccessRequestsByNamespace(where: { isComplete_not: true }) { | ||
id | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
src/authz/graphql-whitelist/httplocalhost4180managerrequests-1cfabf.gql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
|
||
query GetAccessRequest($id: ID!, $rid: String!) { | ||
AccessRequest(where: { id: $id }) { | ||
id | ||
name | ||
isApproved | ||
isIssued | ||
controls | ||
additionalDetails | ||
createdAt | ||
requestor { | ||
name | ||
username | ||
} | ||
application { | ||
name | ||
} | ||
serviceAccess { | ||
id | ||
consumer { | ||
id | ||
username | ||
plugins { | ||
id | ||
name | ||
extForeignKey | ||
config | ||
service { | ||
id | ||
name | ||
extForeignKey | ||
} | ||
route { | ||
id | ||
name | ||
extForeignKey | ||
} | ||
} | ||
} | ||
} | ||
productEnvironment { | ||
name | ||
additionalDetailsToRequest | ||
product { | ||
name | ||
} | ||
credentialIssuer { | ||
availableScopes | ||
clientRoles | ||
} | ||
} | ||
} | ||
|
||
allActivities(sortBy: createdAt_DESC, where: { refId: $rid }) { | ||
id | ||
type | ||
name | ||
action | ||
result | ||
message | ||
context | ||
refId | ||
namespace | ||
extRefId | ||
createdAt | ||
actor { | ||
name | ||
username | ||
} | ||
} | ||
} |
Oops, something went wrong.