Skip to content

Commit

Permalink
Fix hermetic integration tests (#28)
Browse files Browse the repository at this point in the history
- Revert toolchain and use go 1.20 for now.
- Allow *.local domains to use https for testing.
  • Loading branch information
jklein24 authored Dec 14, 2023
2 parents 98fcbc6 + 48e164f commit 9f90856
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
4 changes: 1 addition & 3 deletions examples/lnurl-server/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/lightsparkdev/go-sdk/examples/lnurl-server

go 1.21

toolchain go1.21.0
go 1.20

require (
github.com/gin-gonic/gin v1.9.1
Expand Down
4 changes: 1 addition & 3 deletions examples/remote-signing-server/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/lightsparkdev/go-sdk/examples/remote-signing-server

go 1.21

toolchain go1.21.0
go 1.20

require (
github.com/gin-gonic/gin v1.9.1
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/lightsparkdev/go-sdk

go 1.21

toolchain go1.21.0
go 1.20

require (
github.com/lightsparkdev/lightspark-crypto-uniffi/lightspark-crypto-go v0.0.2-0.20230921052801-1726ad16b251
Expand Down
3 changes: 2 additions & 1 deletion requester/requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ func ValidateBaseUrl(baseUrl string) error {
if err != nil {
return errors.New("invalid base url. Not a valid URL")
}
if parsedUrl.Scheme != "https" && parsedUrl.Hostname() != "localhost" {
isWhitelistedLocalHost := parsedUrl.Hostname() == "localhost" || parsedUrl.Hostname() == "app.minikube.local"
if parsedUrl.Scheme != "https" && !isWhitelistedLocalHost {
return errors.New("invalid base url. Must be https:// if not targeting localhost")
}
return nil
Expand Down

0 comments on commit 9f90856

Please sign in to comment.