You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deployclient: add support for auto-renewing github tokens (#296)
* deployclient: add support for auto-renewing github tokens
Fixes#229.
* grpc/interceptor: check success status code when fetching github token
* actions/deploy: temporarily comment out new variables for testing
echo"::notice ::APIKEY IS DEPRECATED, PLEASE USE WORKLOAD IDENTITY, For more info see https://doc.nais.io/build/how-to/build-and-deploy and/or https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs"
Copy file name to clipboardexpand all lines: pkg/deployclient/config.go
+8-3
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,9 @@ type Config struct {
19
19
DeployServerURLstring
20
20
DryRunbool
21
21
Environmentstring
22
-
GithubTokenstring
22
+
GitHubTokenstring
23
+
GitHubTokenURLstring
24
+
GitHubBearerTokenstring
23
25
GrpcAuthenticationbool
24
26
GrpcUseTLSbool
25
27
OpenTelemetryCollectorURLstring
@@ -52,7 +54,9 @@ func InitConfig(cfg *Config) {
52
54
flag.StringVar(&cfg.DeployServerURL, "deploy-server", getEnv("DEPLOY_SERVER", DefaultDeployServer), "URL to API server. (env DEPLOY_SERVER)")
53
55
flag.BoolVar(&cfg.DryRun, "dry-run", getEnvBool("DRY_RUN", false), "Run templating, but don't actually make any requests. (env DRY_RUN)")
54
56
flag.StringVar(&cfg.Environment, "environment", os.Getenv("ENVIRONMENT"), "Environment for GitHub deployment. Autodetected from nais.yaml if not specified. (env ENVIRONMENT)")
flag.StringVar(&cfg.GitHubToken, "github-token", os.Getenv("GITHUB_TOKEN"), "Deprecated. Use 'github-token-url' and 'github-bearer-token' instead. Github JWT. (env GITHUB_TOKEN)")
58
+
flag.StringVar(&cfg.GitHubTokenURL, "github-token-url", os.Getenv("GITHUB_TOKEN_URL"), "URL for requesting GitHub id_token. (env GITHUB_TOKEN_URL)")
59
+
flag.StringVar(&cfg.GitHubBearerToken, "github-bearer-token", os.Getenv("GITHUB_BEARER_TOKEN"), "Bearer token for use when requesting GitHub id_token. (env GITHUB_BEARER_TOKEN)")
56
60
flag.BoolVar(&cfg.GrpcAuthentication, "grpc-authentication", getEnvBool("GRPC_AUTHENTICATION", true), "Use team API key to authenticate requests. (env GRPC_AUTHENTICATION)")
0 commit comments