Skip to content

Commit

Permalink
fix: Support new productions clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
efirs committed May 12, 2023
1 parent a0f0d8b commit 4c46724
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ type instance struct {
var (
ErrStateMismatched = fmt.Errorf("state is not matched")
ErrInstanceNotFound = fmt.Errorf("instance not found")

defaultInstance = instance{
clientID: "GS8PrHA1aYblUR73yitqomc40ZYZ81jF",
authHost: "https://auth.tigrisdata.cloud/",
audience: "https://tigris-api-prod",
}
)

var (
Expand Down Expand Up @@ -295,7 +301,11 @@ func CmdLow(_ context.Context, host string) error {

inst, ok := instances[host]
if !ok {
return util.Error(fmt.Errorf("%w: %s", ErrInstanceNotFound, host), "Instance config not found")
if !strings.HasSuffix(host, ".tigrisdata.cloud") {
return util.Error(fmt.Errorf("%w: %s", ErrInstanceNotFound, host), "Instance config not found")
}

inst = defaultInstance
}

p, err := oidc.NewProvider(context.Background(), inst.authHost)
Expand Down

0 comments on commit 4c46724

Please sign in to comment.