Skip to content

Commit

Permalink
config: default to authenticate.pomerium.app when authenticate url is…
Browse files Browse the repository at this point in the history
… not specified (#4132)
  • Loading branch information
calebdoxsey committed Apr 26, 2023
1 parent ab55a6c commit 498bc82
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ var defaultOptions = Options{
GRPCAddr: ":443",
GRPCClientTimeout: 10 * time.Second, // Try to withstand transient service failures for a single request
GRPCClientDNSRoundRobin: true,
AuthenticateURLString: "https://authenticate.pomerium.app",
AuthenticateCallbackPath: "/oauth2/callback",
TracingSampleRate: 0.0001,

Expand Down
2 changes: 2 additions & 0 deletions config/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ func TestOptionsFromViper(t *testing.T) {
CookieSecure: true,
InsecureServer: true,
CookieHTTPOnly: true,
AuthenticateURLString: "https://authenticate.pomerium.app",
AuthenticateCallbackPath: "/oauth2/callback",
DataBrokerStorageType: "memory",
EnvoyAdminAccessLogPath: os.DevNull,
Expand All @@ -310,6 +311,7 @@ func TestOptionsFromViper(t *testing.T) {
&Options{
Policies: []Policy{{From: "https://from.example", To: mustParseWeightedURLs(t, "https://to.example")}},
CookieName: "_pomerium",
AuthenticateURLString: "https://authenticate.pomerium.app",
AuthenticateCallbackPath: "/oauth2/callback",
CookieSecure: true,
CookieHTTPOnly: true,
Expand Down
4 changes: 4 additions & 0 deletions internal/autocert/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,10 @@ func sourceHostnames(cfg *config.Config) []string {
}
}

// remove any hosted authenticate URLs
delete(dedupe, "authenticate.pomerium.app")
delete(dedupe, "authenticate.staging.pomerium.app")

var h []string
for k := range dedupe {
h = append(h, k)
Expand Down

0 comments on commit 498bc82

Please sign in to comment.