Skip to content

Commit 485e429

Browse files
committed
Grant permissions in GCP
1 parent 0c91e93 commit 485e429

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

internal/cmd/api/config.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ type oAuthConfig struct {
104104
RedirectURL string `env:"OAUTH_REDIRECT_URL"`
105105

106106
// FrontendURL The URL of the frontend application.
107+
// TODO: This should be removed as we are always on the same domain
107108
FrontendURL string `env:"OAUTH_FRONTEND_URL"`
108109
}
109110

@@ -123,12 +124,6 @@ type Config struct {
123124
LogFormat string `env:"LOG_FORMAT,default=json"`
124125
LogLevel string `env:"LOG_LEVEL,default=info"`
125126

126-
// Names of reconcilers to enable on first run of api
127-
//
128-
// Example: google:gcp:project,nais:namespace
129-
// Valid: [google:gcp:project|google:workspace-admin|nais:namespace|nais:deploy]
130-
FirstRunEnableReconcilers []string `env:"FIRST_RUN_ENABLE_RECONCILERS"`
131-
132127
// StaticServiceAccounts A JSON-encoded value describing a set of service accounts to be created when the
133128
// application starts. Refer to the README for the format.
134129
StaticServiceAccounts fixtures.ServiceAccounts `env:"STATIC_SERVICE_ACCOUNTS"`

internal/database/migrations/0001_schema.sql

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
-- +goose Up
22

3+
-- Grant permissions in GCP if the role cloudsqlsuperuser exists
4+
-- +goose StatementBegin
5+
DO
6+
$$
7+
BEGIN
8+
IF EXISTS (
9+
SELECT FROM pg_catalog.pg_roles
10+
WHERE rolname = 'cloudsqlsuperuser') THEN
11+
GRANT ALL ON SCHEMA public TO cloudsqlsuperuser;
12+
END IF;
13+
END
14+
$$;
15+
-- +goose StatementEnd
16+
317
-- extensions
418
CREATE EXTENSION fuzzystrmatch;
519

0 commit comments

Comments
 (0)