From d03bc44f2fdf808a9bbc29d3c827727f26941845 Mon Sep 17 00:00:00 2001 From: Pierre Bastianelli Date: Mon, 16 Dec 2024 15:10:44 -0800 Subject: [PATCH 1/6] chore: roles with admin --- chart/cas-cif/Chart.lock | 4 ++-- schema/deploy/create_roles.sql | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/chart/cas-cif/Chart.lock b/chart/cas-cif/Chart.lock index b82534374e..bd39a957ec 100644 --- a/chart/cas-cif/Chart.lock +++ b/chart/cas-cif/Chart.lock @@ -11,5 +11,5 @@ dependencies: - name: certbot repository: https://bcdevops.github.io/certbot version: 0.1.3 -digest: sha256:22a3c8a861907a570a2415e8c4b5c0a5c7f6ae164207507f093b0bfaa752c8cf -generated: "2024-02-23T14:03:27.259123-08:00" +digest: sha256:d2da5fb2e1380ca061fdadb0e4cbe54137f1e3d43f90afe245339ddb320a771b +generated: "2024-12-16T11:23:41.617911-08:00" diff --git a/schema/deploy/create_roles.sql b/schema/deploy/create_roles.sql index 5ad396b87c..1a341b59bd 100644 --- a/schema/deploy/create_roles.sql +++ b/schema/deploy/create_roles.sql @@ -12,7 +12,7 @@ begin from pg_catalog.pg_roles where rolname = 'cif_internal') then - create role cif_internal; + create role cif_internal with admin current_user; end if; if not exists ( @@ -20,7 +20,7 @@ begin from pg_catalog.pg_roles where rolname = 'cif_external') then - create role cif_external; + create role cif_external with admin current_user; end if; if not exists ( @@ -28,7 +28,7 @@ begin from pg_catalog.pg_roles where rolname = 'cif_admin') then - create role cif_admin; + create role cif_admin with admin current_user; end if; if not exists ( @@ -36,7 +36,7 @@ begin from pg_catalog.pg_roles where rolname = 'cif_guest') then - create role cif_guest; + create role cif_guest with admin current_user; end if; if not exists ( @@ -44,7 +44,7 @@ begin from pg_catalog.pg_roles where rolname = 'cifapp') then - create user cifapp; + create user cifapp with admin current_user; end if; grant cif_admin, cif_internal, cif_external, cif_guest to cifapp; From 279ad434e9ef6e157d0f4a8aa48fc5f16eef5971 Mon Sep 17 00:00:00 2001 From: Pierre Bastianelli Date: Mon, 16 Dec 2024 15:30:02 -0800 Subject: [PATCH 2/6] chore: test --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4462536cd4..6e5faf87e8 100644 --- a/Makefile +++ b/Makefile @@ -244,7 +244,7 @@ install: HELM_OPTS=--atomic --wait-for-jobs --timeout 2400s --namespace $(NAMESP --values $(CHART_DIR)/values-$(ENVIRONMENT).yaml install: @set -euo pipefail; \ - dagConfig=$$(echo '{"org": "bcgov", "repo": "cas-cif", "ref": "$(GIT_SHA1)", "path": "dags/cas_cif_dags.py"}' | base64 -w0); \ + dagConfig=$$(echo '{"org": "bcgov", "repo": "cas-cif", "ref": "$(GIT_SHA1)", "path": "dags/cas_cif_dags.py"}' | base64 ); \ helm dep up $(CHART_DIR); \ if ! helm status --namespace $(NAMESPACE) $(CHART_INSTANCE); then \ echo 'Installing the application and issuing SSL certificate'; \ From 800a85c742bfc5bc19e2733073db9087d058aa2f Mon Sep 17 00:00:00 2001 From: Pierre Bastianelli Date: Tue, 17 Dec 2024 13:45:25 -0800 Subject: [PATCH 3/6] chore: accidental makefile change --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6e5faf87e8..4462536cd4 100644 --- a/Makefile +++ b/Makefile @@ -244,7 +244,7 @@ install: HELM_OPTS=--atomic --wait-for-jobs --timeout 2400s --namespace $(NAMESP --values $(CHART_DIR)/values-$(ENVIRONMENT).yaml install: @set -euo pipefail; \ - dagConfig=$$(echo '{"org": "bcgov", "repo": "cas-cif", "ref": "$(GIT_SHA1)", "path": "dags/cas_cif_dags.py"}' | base64 ); \ + dagConfig=$$(echo '{"org": "bcgov", "repo": "cas-cif", "ref": "$(GIT_SHA1)", "path": "dags/cas_cif_dags.py"}' | base64 -w0); \ helm dep up $(CHART_DIR); \ if ! helm status --namespace $(NAMESPACE) $(CHART_INSTANCE); then \ echo 'Installing the application and issuing SSL certificate'; \ From 6df67e293c51ff0861da1eef89b3bca1c8bc62be Mon Sep 17 00:00:00 2001 From: Pierre Bastianelli Date: Tue, 17 Dec 2024 14:43:17 -0800 Subject: [PATCH 4/6] chore: role admins to cif --- schema/deploy/create_roles.sql | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/schema/deploy/create_roles.sql b/schema/deploy/create_roles.sql index 1a341b59bd..22d6629c59 100644 --- a/schema/deploy/create_roles.sql +++ b/schema/deploy/create_roles.sql @@ -12,7 +12,7 @@ begin from pg_catalog.pg_roles where rolname = 'cif_internal') then - create role cif_internal with admin current_user; + create role cif_internal with admin cif; end if; if not exists ( @@ -20,7 +20,7 @@ begin from pg_catalog.pg_roles where rolname = 'cif_external') then - create role cif_external with admin current_user; + create role cif_external with admin cif; end if; if not exists ( @@ -28,7 +28,7 @@ begin from pg_catalog.pg_roles where rolname = 'cif_admin') then - create role cif_admin with admin current_user; + create role cif_admin with admin cif; end if; if not exists ( @@ -36,7 +36,7 @@ begin from pg_catalog.pg_roles where rolname = 'cif_guest') then - create role cif_guest with admin current_user; + create role cif_guest with admin cif; end if; if not exists ( @@ -44,9 +44,10 @@ begin from pg_catalog.pg_roles where rolname = 'cifapp') then - create user cifapp with admin current_user; + create user cifapp with admin cif; end if; + grant cif_admin, cif_internal, cif_external, cif_guest to cifapp; execute format('grant create, connect on database %I to cifapp', current_database()); From 97c9051b4e8b577124552a0ae804577a462da2b6 Mon Sep 17 00:00:00 2001 From: Pierre Bastianelli Date: Tue, 17 Dec 2024 14:43:55 -0800 Subject: [PATCH 5/6] chore: release v1.18.1 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- schema/sqitch.plan | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 972443edc2..a29de988bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.18.1](https://github.com/bcgov/cas-cif/compare/1.18.0...1.18.1) (2024-12-17) + +### Reverts + +- Revert "chore: install oc" ([f6db743](https://github.com/bcgov/cas-cif/commit/f6db7436626dba58b33a0be41455ce9ffda0a0df)) + # [1.18.0](https://github.com/bcgov/cas-cif/compare/1.17.3...1.18.0) (2024-12-16) ## [1.17.3](https://github.com/bcgov/cas-cif/compare/1.17.1...1.17.3) (2024-12-13) diff --git a/package.json b/package.json index 128de2dac8..7a415039c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cas-cif", - "version": "1.18.0", + "version": "1.18.1", "main": "index.js", "repository": "https://github.com/bcgov/cas-cif.git", "author": "ggircs@gov.bc.ca", diff --git a/schema/sqitch.plan b/schema/sqitch.plan index a5fc01ae42..145a92b03f 100644 --- a/schema/sqitch.plan +++ b/schema/sqitch.plan @@ -382,3 +382,4 @@ tables/funding_stream_rfp_002 2024-05-28T22:41:57Z Brianna Cerkiewicz # dropping regprocedure type for column in favour of varchar to allow postgres version upgrade @1.17.3 2024-12-13T19:33:09Z Pierre Bastianelli # release v1.17.3 @1.18.0 2024-12-16T18:54:31Z Pierre Bastianelli # release v1.18.0 +@1.18.1 2024-12-17T22:43:51Z Pierre Bastianelli # release v1.18.1 From 6e097fad6e3db88f3d91c8a99437b9665cb83f79 Mon Sep 17 00:00:00 2001 From: Pierre Bastianelli Date: Tue, 17 Dec 2024 14:48:51 -0800 Subject: [PATCH 6/6] chore: grant to current_user --- schema/deploy/create_roles.sql | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/schema/deploy/create_roles.sql b/schema/deploy/create_roles.sql index 22d6629c59..1a341b59bd 100644 --- a/schema/deploy/create_roles.sql +++ b/schema/deploy/create_roles.sql @@ -12,7 +12,7 @@ begin from pg_catalog.pg_roles where rolname = 'cif_internal') then - create role cif_internal with admin cif; + create role cif_internal with admin current_user; end if; if not exists ( @@ -20,7 +20,7 @@ begin from pg_catalog.pg_roles where rolname = 'cif_external') then - create role cif_external with admin cif; + create role cif_external with admin current_user; end if; if not exists ( @@ -28,7 +28,7 @@ begin from pg_catalog.pg_roles where rolname = 'cif_admin') then - create role cif_admin with admin cif; + create role cif_admin with admin current_user; end if; if not exists ( @@ -36,7 +36,7 @@ begin from pg_catalog.pg_roles where rolname = 'cif_guest') then - create role cif_guest with admin cif; + create role cif_guest with admin current_user; end if; if not exists ( @@ -44,10 +44,9 @@ begin from pg_catalog.pg_roles where rolname = 'cifapp') then - create user cifapp with admin cif; + create user cifapp with admin current_user; end if; - grant cif_admin, cif_internal, cif_external, cif_guest to cifapp; execute format('grant create, connect on database %I to cifapp', current_database());