-
Notifications
You must be signed in to change notification settings - Fork 101
feat(#6256): default hosted mint URL to mint.fullsend.sh #6261
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
03e09bc
a766d90
a0a53ba
7430f86
5d42f31
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 | ||
|
|
@@ -205,11 +216,13 @@ func validateMintURL(raw string) error { | |
| if err != nil { | ||
| return err | ||
| } | ||
| if !strings.HasSuffix(parsed.Host, ".run.app") && | ||
| !strings.HasSuffix(parsed.Host, ".cloudfunctions.net") { | ||
| return fmt.Errorf("--mint-url must be a Cloud Run URL (.run.app or .cloudfunctions.net), got host %q", parsed.Host) | ||
| host := parsed.Hostname() | ||
| if strings.EqualFold(host, "mint.fullsend.sh") || | ||
| strings.HasSuffix(host, ".run.app") || | ||
| strings.HasSuffix(host, ".cloudfunctions.net") { | ||
| return nil | ||
| } | ||
| return nil | ||
| return fmt.Errorf("--mint-url must be a hosted mint or Cloud Run URL (.fullsend.sh, .run.app, or .cloudfunctions.net), got host %q", host) | ||
|
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-consistency Error message says '.fullsend.sh' but the code only accepts the exact hostname 'mint.fullsend.sh'. The message mixes a suffix pattern (.fullsend.sh) with what is actually an exact-match check. Suggested fix: Change the error message to reference 'mint.fullsend.sh' explicitly. |
||
| } | ||
|
|
||
| func validateSkipMintCheck(mintURL string) error { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[low] permission-expansion
The validateMintURL hostname allowlist now accepts the exact host mint.fullsend.sh (via case-insensitive EqualFold) in addition to the pre-existing .run.app and .cloudfunctions.net suffix checks. Safe against subdomain-prefix bypass. HTTPS and no-credentials checks remain enforced. No security regression; noting for visibility.