Skip to content

Commit

Permalink
Create Latest Release (#489)
Browse files Browse the repository at this point in the history
* First pass at new consumers table.

* Stub out filters.

* Finish base filter behavior.

* Finish basic POC of filters.

* Fix up consumers list page.

* Add proper id to search logic

* First pass at approval dialog

* First pass at laying out access request dialog.

* Add working forms.

* Fix possible empty object

* Proxy access requests.

* Add missing allowed query.

* Touch up some files.

* Wire up conditional select options.

* Wire up auth and controls.

* Bubble controls up to the top level.

* Finish forms and add data-testids

* First pass at new consumers table.

* Stub out filters.

* Finish base filter behavior.

* Finish basic POC of filters.

* Fix up consumers list page.

* Add proper id to search logic

* First pass at consumers unit tests.

* Fix type error.

* Unit tests for consumers index page functionality.

* Add mocks for access request

* Fix some tests, start grant access dialog

* Add tests for request details and controls

* Add more unit tests for access requests so consumers page tests can be lighter

* Dialog and controls tests.

* Add grant access dialog tests.

* Clean up consumers tests.

* First pass at detail page layout.

* Add restrictions.

* Handle restrictions

* UI layout tweaks and add edit form.

* First pass at editing controls.

* Finish first pass at refactor of consumers.

* Update tests.

* Finish IP restrictions test.

* Fix up tests.

* Add some coverage and fix broken tests.

* Add some edit dialog tests

* initial backend changes for getFilteredNamespaceConsumers

* add backend for getNamespaceConsumerAccess

* put back application owner in detail page

* upd backend support for getConsumerProdEnvAccess

* Update tests, organize MSW directory and add new consumers page query

* backend getConsumerProdEnvAccess query

* upd tests for backend

* upd backend ConsumerProdEnvAccess object

* Wire up auth, wire up UI for new API changes.

* upd services for consumer access detail

* Wire up edit dialog with new API.

* Fix type errors

* Fix some props access on the consumers detail page.

* Remove debugger

* upd backend updateConsumerAccess and saveConsumerLabels

* adj request details on consumer

* Update edit dialog and mock data.

* Add app owner.

* upd app owner for consumer detail and graphql whitelist

* upd whitelist for access review

* add allConsumerGroupLabels

* Add new manage labels dialog.

* tweak grant access dialog

* upd permissions and whitelist for saving labels

* Added Scenarios for Refresh Credentials, API Test and update existing client credential scenarios

* Wire up manage labels on consumers index page.

* Update grant access dialog

* add filter for consumer list

* add filter for consumer list

* add revokeAccessFromConsumer backend call

* for grant access scopes and roles are optional

* add revokeAccessFromConsumer backend call

* request details optional on edit dialog

* 1) Change config of oauth2 proxy and keycloak
2) Update cypress tests

* Refactor filters.

* filters structure for labels changed a bit

* Use names in filters instead of ids. Prevent duplicates

* wire up filtering for consumers

* wire up consumer scope and role backend for filter selection

* Wire up labels to the UI

* fix failing build

* add backend scope search logic

* Add loading state to filters.

* Add new add label group interface.

* new whitelist query for manage labels

* save labels remove blank label

* Update labels functionality, rework filters.

* add whitelist for consumer list query

* consumer read for api owner

* fix a ssr invalid query

* Cache fixes, proper naming in request dialog

* Add caching to filters, minor UI improvements.

* updates for consumer plugins

* fix edit consumer

* disable filtering

* handle services not linked to products

* inc whitelist for reject request

* fix plugin matching for consumer detail

* filter bug

* Fix the filters when no session storage.

* upd plugin service and route lisst

* add role update for consumer

* Add labels to access request

* Add test-ids

* resource tune for proto-generic-api and -mongodb

* wire up labels on access request

* remove dev,test,prod on push from ci-build-deploy

* Add revoke and hide application row if null

* fix for revoking access

* missing whitelist for revoke access

* 1)updated scenarios as per new Consumer UI
2)Added data-testid in filrwes.tsx page
3)Update keystone db schema as per new changes

* upd query types

* upd types

* remove svc accts from consumer list and fix plugin error

* stop using service access id in consumer list

* fix consumer product edit dialog

* improve plugin update comparison

* upd plugins when grant new product to consumer

* remove from whitelist the deleteGatewayConsumer

* delete consumer upds

* fix my access and access lists

* dedup list of scopes

* Add some custom error messages

* Remove bcsc user menu option

* Use unified error in toasts

* fix 427 api key not getting deleted

* resolve 443 creds for jwt key pair

* fix org dataset operations

* Standardize toasts to all be closable with only a startcase capitalized

* add test branch back in to ci-build-deploy

* fix revoke access whitelist

* Comment out flaky verification step

* fix ci-build-deploy indent

* Fix yaml formatting

* add in resources

Co-authored-by: Joshua Jones <[email protected]>
Co-authored-by: ikethecoder <[email protected]>
Co-authored-by: Niraj Patel <[email protected]>
Co-authored-by: nirajCITZ <[email protected]>
Co-authored-by: Justin Tendeck <[email protected]>
Co-authored-by: ikethecoder <[email protected]>
Co-authored-by: jTendeck <[email protected]>
  • Loading branch information
8 people authored Aug 9, 2022
1 parent f3e3274 commit f1aae30
Show file tree
Hide file tree
Showing 305 changed files with 39,671 additions and 28,835 deletions.
6 changes: 5 additions & 1 deletion .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ OIDC_ISSUER=http://keycloak.localtest.me:9080/auth/realms/master
LOCAL_ENV=true
WORKING_PATH=/tmp
DESTINATION_URL=
SSR_API_ROOT=http://apsportal.localtest.me:3000
SSR_API_ROOT=http://apsportal.localtest.me:3000
NEXT_PUBLIC_DEVELOPER_IDS=idir,bceid,bcsc,github
NEXT_PUBLIC_PROVIDER_IDS=idir
NEXT_PUBLIC_ACCOUNT_BCEID_URL=https://www.test.bceid.ca/logon.aspx?returnUrl=/profile_management
NEXT_PUBLIC_ACCOUNT_BCSC_URL=https://idtest.gov.bc.ca/account/
19 changes: 13 additions & 6 deletions .github/workflows/ci-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and Deploy

on:
push:
branches: [dev, test, main, feature/*]
branches: [feature/*, test]

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -116,12 +116,12 @@ jobs:
size: 2Gi
resources:
requests:
cpu: 85m
memory: 480M
limits:
cpu: 300m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
memory: 720M
podSecurityContext:
enabled: true
Expand Down Expand Up @@ -164,6 +164,14 @@ jobs:
containerPort: 3000
resources:
requests:
cpu: 20m
memory: 400M
limits:
cpu: 100m
memory: 800M
oauthProxy:
enabled: true
image:
Expand All @@ -189,7 +197,6 @@ jobs:
skip-jwt-bearer-tokens: 'false'
set-authorization-header: 'false'
pass-authorization-header: 'false'
env:
SESSION_SECRET:
value: '234873290483290'
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/test-next.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: test-next
on:
pull_request:
branches: [dev, main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v1
- name: use cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test:next
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.15.1
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ services:
aliases:
- keycloak.localtest.me
oauth2-proxy:
image: quay.io/oauth2-proxy/oauth2-proxy:v7.1.3
image: quay.io/oauth2-proxy/oauth2-proxy:v7.2.0
container_name: oauth2-proxy
command: --config ./oauth2-proxy.cfg
depends_on:
Expand Down
6 changes: 6 additions & 0 deletions e2e/cypress/fixtures/access-manager.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@
},
"serviceAccount": {
"scopes": ["GatewayConfig.Publish", "Namespace.Manage", "Content.Publish"]
},
"labels_consumer1":{
"labels":{"Name": "LondonDrug#6445", "Phone": "4523145232", "Manager": "John Smith"}
},
"labels_consumer2":{
"labels":{"Name": "LondonDrug#7865", "Phone": "6043445434", "Manager": "John Smith"}
}
}
102 changes: 101 additions & 1 deletion e2e/cypress/fixtures/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"apiDirectory": {
"endPoint": "ds/api/v2/namespaces",
"orgEndPoint": "ds/api/v2/organizations",
"directoryEndPoint": "ds/api/v2/directory",
"headers": {
"accept": "application/json",
"content-type": "application/json"
Expand All @@ -61,9 +62,80 @@
"download_audience": "Public",
"notes": "Some notes",
"title": "Dataset for Test API",
"isInCatalog": "false",
"isDraft": "false",
"tags": ["gateway", "kong"],
"organization": "ministry-of-health",
"organizationUnit": "planning-and-innovation-division"
},
"directory": {
"name": "api-auto-test-product",
"title": "API Auto Test Product",
"notes": "API Gateway Services provides a way to configure services on the API Gateway, manage access to APIs and get insight into the use of them.",
"license_title": "Access Only",
"view_audience": "Government",
"security_class": "LOW-PUBLIC",
"tags": ["gateway", "kong", "openapi"],
"organization": {
"name": "ministry-of-health",
"title": "Ministry of Health"
},
"organizationUnit": {
"name": "planning-and-innovation-division",
"title": "Planning and Innovation Division"
},
"products": [
{
"name": "API Auto Test Product",
"environments": [
{
"name": "dev",
"active": true,
"flow": "kong-api-key-acl"
}
]
}
]
},
"namespaceDirectory": {
"name": "client-credentials-test-product",
"title": "Client Credentials Test Product",
"notes": "API Gateway Services provides a way to configure services on the API Gateway, manage access to APIs and get insight into the use of them.",
"license_title": "Access Only",
"view_audience": "Government",
"security_class": "LOW-PUBLIC",
"tags": ["gateway", "kong", "openapi"],
"organization": {
"name": "ministry-of-health",
"title": "Ministry of Health"
},
"organizationUnit": {
"name": "planning-and-innovation-division",
"title": "Planning and Innovation Division"
},
"products": [
{
"id": "2",
"name": "Client Credentials Test Product",
"environments": [
{
"name": "test",
"active": true,
"flow": "client-credentials"
},
{
"name": "dev",
"active": true,
"flow": "client-credentials"
},
{
"name": "sandbox",
"active": true,
"flow": "client-credentials"
}
]
}
]
}
},
"authorizationProfiles": {
Expand Down Expand Up @@ -116,6 +188,34 @@
"accept": "application/json",
"content-type": "application/json"
},
"endPoint": "ds/api/v2/namespaces"
"endPoint": "ds/api/v2/namespaces",
"activity": {
"name": "newplatform",
"scopes": [
{
"name": "GatewayConfig.Publish"
},
{
"name": "Namespace.Manage"
},
{
"name": "Access.Manage"
},
{
"name": "Content.Publish"
},
{
"name": "Namespace.View"
},
{
"name": "CredentialIssuer.Admin"
}
],
"permDomains": [".api.gov.bc.ca"],
"permDataPlane": "local.dataplane",
"permProtectedNs": "deny",
"org": "ministry-of-health",
"orgUnit": "planning-and-innovation-division"
}
}
}
108 changes: 69 additions & 39 deletions e2e/cypress/fixtures/apiowner.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,33 @@
"optionalInstructions": "This is a automation test",
"serviceName": "a-service-for-newplatform"
}
},
"test_environment": {
"name": "test",
"config": {
"terms": "Terms of Use for API Gateway",
"authorization": "Kong API Key with ACL Flow",
"optionalInstructions": "This is a automation test",
"serviceName": "a-service-for-newplatform-test"
}
}
},
"clientCredentials": {
"namespace": "ccplatform",
"serviceName": "cc-service-for-platform",
"Mark": {
"userName": "mark",
"accessRole": ["Access.Manage"]
},
"Wendy": {
"userName": "wendy",
"accessRole": ["CredentialIssuer.Admin"]
},
"jwtKeyPair": {
"authProfile": {
"name": "cy-jwt-kp-auth",
"flow": "Client Credential Flow",
"element":"cc-jwt-key",
"element": "cc-jwt-key",
"clientAuthenticator": "Signed JWT - Generated Key Pair",
"environmentConfig": {
"environment": "Development",
Expand All @@ -71,7 +89,7 @@
"authProfile": {
"name": "cy-jwks-url-auth",
"flow": "Client Credential Flow",
"element":"cc-jwt-jwks",
"element": "cc-jwt-jwks",
"clientAuthenticator": "Signed JWT with JWKS URL",
"environmentConfig": {
"environment": "Sandbox",
Expand Down Expand Up @@ -110,7 +128,7 @@
"authProfile": {
"name": "cy-client-id-secret-auth",
"flow": "Client Credential Flow",
"element":"cc-id-secret",
"element": "cc-id-secret",
"clientAuthenticator": "Client ID and Secret",
"environmentConfig": {
"environment": "Test",
Expand All @@ -137,59 +155,71 @@
}
},
"grantPermission": {
"Mark":{
"userName" :"mark",
"accessRole" :["Access.Manage","Namespace.View"]
"Mark": {
"userName": "mark",
"accessRole": ["Access.Manage", "Namespace.View"]
},
"Wendy":{
"userName" :"wendy",
"accessRole" :["Namespace.Manage","CredentialIssuer.Admin"]
"Wendy": {
"userName": "wendy",
"accessRole": ["Namespace.Manage", "CredentialIssuer.Admin"]
},
"Wendy_GC":{
"userName" :"wendy",
"accessRole" :["GatewayConfig.Publish","Namespace.View"]
"Wendy_GC": {
"userName": "wendy",
"accessRole": ["GatewayConfig.Publish", "Namespace.View"]
},
"Janis":{
"userName" :"janis@idir",
"accessRole" :["Namespace.Manage","CredentialIssuer.Admin"]
}
"Janis": {
"userName": "janis@idir",
"accessRole": ["Namespace.Manage", "CredentialIssuer.Admin"]
}
},
"revokePermission": {
"Mark":{
"userName" :"mark",
"accessRole" :["Namespace.View","Access.Manage"]
"Mark": {
"userName": "mark",
"accessRole": ["Namespace.View", "Access.Manage"]
},
"Mark_AM":{
"userName" :"mark",
"accessRole" :["Access.Manage"]
"Mark_AM": {
"userName": "mark",
"accessRole": ["Access.Manage"]
},
"Wendy":{
"userName" :"wendy",
"accessRole" :["Namespace.Manage"]
"Wendy": {
"userName": "wendy",
"accessRole": ["Namespace.Manage"]
},
"Wendy_ci":{
"userName" :"wendy",
"accessRole" :["CredentialIssuer.Admin"]
"Wendy_ci": {
"userName": "wendy",
"accessRole": ["CredentialIssuer.Admin"]
},
"serviceAccount": {
"scopes": ["Namespace.Manage", "Content.Publish"]
"scopes": ["Namespace.Manage", "Content.Publish"]
}
}
},
"grantPermission": {
"Mark":{
"userName" :"mark",
"accessRole" :["Access.Manage","Namespace.View"]
}
"Mark": {
"userName": "mark",
"accessRole": ["Access.Manage", "Namespace.View"]
}
},
"permission": {
"Mark":{
"userName" :"mark",
"accessRole" :["Access.Manage","Namespace.View"]
}
"Mark": {
"userName": "mark",
"accessRole": ["Access.Manage", "Namespace.View"]
}
},
"apiTest": {
"namespace": "apiplatform",
"delete_namespace": "deleteplatform1"
"delete_namespace": "testplatform",
"product": {
"name": "API Auto Test Product",
"environment": {
"name": "dev",
"config": {
"terms": "Terms of Use for API Gateway",
"authorization": "Kong API Key with ACL Flow",
"optionalInstructions": "This is a automation test",
"serviceName": "a-service-for-apiplatform"
}
}
}
}
}
}
Loading

0 comments on commit f1aae30

Please sign in to comment.