Repository navigation
fix: reapply mint.fullsend.sh as default hosted mint URL #6290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,7 @@ import ( | |
| // DefaultMintURL is the hosted public mint URL used when --mint-url is not | ||
| // explicitly provided. Users who self-host a mint can override this via | ||
| // the --mint-url flag. | ||
| const DefaultMintURL = "https://fullsend-mint-gljhbkcloq-uc.a.run.app" | ||
| const DefaultMintURL = "https://mint.fullsend.sh" | ||
|
|
||
| // adminMintDiscovery holds the results of a mint infrastructure discovery call. | ||
| type adminMintDiscovery struct { | ||
|
|
@@ -197,6 +197,17 @@ func validateWIFProvider(raw string) error { | |
| return nil | ||
| } | ||
|
|
||
| // IsHostedMintURL reports whether raw is the hosted community mint URL | ||
| // (mint.fullsend.sh). This check is also used by pkg/e2etest to resolve | ||
| // the GCP project for hosted-mint enrollment. | ||
| func IsHostedMintURL(raw string) bool { | ||
| parsed, err := url.Parse(raw) | ||
| if err != nil { | ||
| return false | ||
| } | ||
| return strings.EqualFold(parsed.Hostname(), "mint.fullsend.sh") | ||
| } | ||
|
|
||
| func validateMintURL(raw string) error { | ||
| if err := validateMintURLHTTPS(raw); err != nil { | ||
| return err | ||
|
|
@@ -206,11 +217,12 @@ func validateMintURL(raw string) error { | |
| return err | ||
| } | ||
| host := parsed.Hostname() | ||
| if !strings.HasSuffix(host, ".run.app") && | ||
| !strings.HasSuffix(host, ".cloudfunctions.net") { | ||
| return fmt.Errorf("--mint-url must be a Cloud Run URL (.run.app or .cloudfunctions.net), got host %q", host) | ||
| if strings.EqualFold(host, "mint.fullsend.sh") || | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] DRY-internal-reuse validateMintURL duplicates the mint.fullsend.sh hostname check that IsHostedMintURL already encapsulates. Suggested fix: Consider extracting the hostname comparison into a helper that takes a pre-parsed hostname. |
||
| strings.HasSuffix(host, ".run.app") || | ||
| strings.HasSuffix(host, ".cloudfunctions.net") { | ||
| return nil | ||
| } | ||
| return nil | ||
| return fmt.Errorf("--mint-url must be mint.fullsend.sh or a Cloud Run URL (.run.app or .cloudfunctions.net), got host %q", host) | ||
| } | ||
|
|
||
| func validateSkipMintCheck(mintURL string) error { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -664,10 +664,15 @@ func (p *Provisioner) provisionWithExistingMint(ctx context.Context) (map[string | |
| } | ||
|
|
||
| parsedURL, err := url.Parse(p.cfg.MintURL) | ||
| if err != nil || parsedURL.Scheme != "https" || | ||
| (!strings.HasSuffix(parsedURL.Host, ".run.app") && | ||
| !strings.HasSuffix(parsedURL.Host, ".cloudfunctions.net")) { | ||
| return nil, fmt.Errorf("MintURL %q must be a valid Cloud Run URL (.run.app or .cloudfunctions.net)", p.cfg.MintURL) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("MintURL %q must be mint.fullsend.sh or a Cloud Run URL (.run.app or .cloudfunctions.net)", p.cfg.MintURL) | ||
| } | ||
| host := parsedURL.Hostname() | ||
| if parsedURL.Scheme != "https" || | ||
| (!strings.EqualFold(host, "mint.fullsend.sh") && | ||
| !strings.HasSuffix(host, ".run.app") && | ||
| !strings.HasSuffix(host, ".cloudfunctions.net")) { | ||
| return nil, fmt.Errorf("MintURL %q must be mint.fullsend.sh or a Cloud Run URL (.run.app or .cloudfunctions.net)", p.cfg.MintURL) | ||
| } | ||
|
|
||
| // Store new PEMs once per role (shared across orgs on the mint). | ||
|
|
@@ -1003,9 +1008,14 @@ func (p *Provisioner) provisionSelfManaged(ctx context.Context) (map[string]stri | |
| } | ||
|
|
||
| parsedURL, err := url.Parse(mintURL) | ||
| if err != nil || parsedURL.Scheme != "https" || | ||
| (!strings.HasSuffix(parsedURL.Host, ".run.app") && | ||
| !strings.HasSuffix(parsedURL.Host, ".cloudfunctions.net")) { | ||
| if err != nil { | ||
| return nil, fmt.Errorf("function URL %q is not a valid Cloud Run URL", mintURL) | ||
| } | ||
| host := parsedURL.Hostname() | ||
| if parsedURL.Scheme != "https" || | ||
| (!strings.EqualFold(host, "mint.fullsend.sh") && | ||
| !strings.HasSuffix(host, ".run.app") && | ||
| !strings.HasSuffix(host, ".cloudfunctions.net")) { | ||
| return nil, fmt.Errorf("function URL %q is not a valid Cloud Run URL", mintURL) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] error-message-inconsistency Error messages in provisionSelfManaged say 'function URL is not a valid Cloud Run URL' but validation now accepts mint.fullsend.sh. The provisionWithExistingMint block was updated but provisionSelfManaged retains the old wording in both error branches (lines 1012 and 1019). Suggested fix: Update both error format strings to match the other validation sites. |
||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.