diff options
author | Krasimir Angelov <kangelov@gitlab.com> | 2019-10-31 03:51:24 +0300 |
---|---|---|
committer | Krasimir Angelov <kangelov@gitlab.com> | 2019-11-06 02:44:48 +0300 |
commit | e4daad77c9124e616002b2fb2ea3d96094132761 (patch) | |
tree | 39c4458de8f8ef2d765aefc70bbcab4b8178039a | |
parent | 566f49ea74c88a50e4a4b572f37af3184a33499d (diff) |
Add minimal support for the api-secret-key config flag
Related to https://gitlab.com/gitlab-org/gitlab/issues/28781 and
https://gitlab.com/gitlab-org/gitlab-pages/issues/253.
-rw-r--r-- | acceptance_test.go | 6 | ||||
-rw-r--r-- | main.go | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/acceptance_test.go b/acceptance_test.go index 44dbc90d..ec807d3d 100644 --- a/acceptance_test.go +++ b/acceptance_test.go @@ -1513,3 +1513,9 @@ func TestTLSVersions(t *testing.T) { }) } } + +func TestApiSecretKeyFlagIsSupported(t *testing.T) { + skipUnlessEnabled(t) + teardown := RunPagesProcess(t, *pagesBinary, listeners, "", "-api-secret-key", "/path/to/secret.key") + defer teardown() +} @@ -57,6 +57,7 @@ var ( secret = flag.String("auth-secret", "", "Cookie store hash key, should be at least 32 bytes long.") gitLabAuthServer = flag.String("auth-server", "", "DEPRECATED, use gitlab-server instead. GitLab server, for example https://www.gitlab.com") gitLabServer = flag.String("gitlab-server", "", "GitLab server, for example https://www.gitlab.com") + gitLabAPISecretKey = flag.String("api-secret-key", "", "File with secret key used to authenticate with the GitLab API (NOT YET IMPLEMENTED)") clientID = flag.String("auth-client-id", "", "GitLab application Client ID") clientSecret = flag.String("auth-client-secret", "", "GitLab application Client Secret") redirectURI = flag.String("auth-redirect-uri", "", "GitLab application redirect URI") @@ -237,9 +238,14 @@ func loadConfig() appConfig { "tls-max-version": *tlsMaxVersion, "use-http-2": config.HTTP2, "gitlab-server": config.GitLabServer, + "api-secret-key": *gitLabAPISecretKey, "auth-redirect-uri": config.RedirectURI, }).Debug("Start daemon with configuration") + if *gitLabAPISecretKey != "" { + log.Warn("api-secret-key parameter is a placeholder for future developments, this option will be ignored.") + } + return config } |