mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-20 16:49:03 +02:00
chore(deps): update Go to v1.27.0
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
|
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
|
||||||
"features": {
|
"features": {
|
||||||
"ghcr.io/devcontainers/features/go:1": {
|
"ghcr.io/devcontainers/features/go:1": {
|
||||||
"version": "1.26"
|
"version": "1.27"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"customizations": {
|
"customizations": {
|
||||||
|
|||||||
+1
-1
@@ -74,7 +74,7 @@ If you use [Dev Containers](https://code.visualstudio.com/docs/remote/containers
|
|||||||
If you don't use Dev Containers, you need to install the following tools manually:
|
If you don't use Dev Containers, you need to install the following tools manually:
|
||||||
|
|
||||||
- [Node.js](https://nodejs.org/en/download/) >= 24
|
- [Node.js](https://nodejs.org/en/download/) >= 24
|
||||||
- [Go](https://golang.org/doc/install) >= 1.26
|
- [Go](https://golang.org/doc/install) >= 1.27
|
||||||
- [Git](https://git-scm.com/downloads)
|
- [Git](https://git-scm.com/downloads)
|
||||||
|
|
||||||
#### 2. Setup
|
#### 2. Setup
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
module github.com/pocket-id/pocket-id/backend
|
module github.com/pocket-id/pocket-id/backend
|
||||||
|
|
||||||
go 1.26.6
|
go 1.27.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/aws/aws-sdk-go-v2 v1.43.7
|
github.com/aws/aws-sdk-go-v2 v1.43.7
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ func TestOidcClientDto_secrets(t *testing.T) {
|
|||||||
expired := datatype.DateTime(time.Now().Add(-time.Hour))
|
expired := datatype.DateTime(time.Now().Add(-time.Hour))
|
||||||
valid := datatype.DateTime(time.Now().Add(time.Hour))
|
valid := datatype.DateTime(time.Now().Add(time.Hour))
|
||||||
client := model.OidcClient{
|
client := model.OidcClient{
|
||||||
Base: model.Base{ID: "client-id"},
|
ID: "client-id",
|
||||||
Name: "Test Client",
|
Name: "Test Client",
|
||||||
Credentials: model.OidcClientCredentials{
|
Credentials: model.OidcClientCredentials{
|
||||||
Secrets: []model.OidcClientSecret{
|
Secrets: []model.OidcClientSecret{
|
||||||
@@ -109,7 +109,7 @@ func TestOidcClientDto_secrets(t *testing.T) {
|
|||||||
|
|
||||||
func TestOidcClientDto_secretsAlwaysSerialized(t *testing.T) {
|
func TestOidcClientDto_secretsAlwaysSerialized(t *testing.T) {
|
||||||
client := model.OidcClient{
|
client := model.OidcClient{
|
||||||
Base: model.Base{ID: "client-id"},
|
ID: "client-id",
|
||||||
Name: "Test Client",
|
Name: "Test Client",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ func init() {
|
|||||||
|
|
||||||
// Use JSON tags to keep client-visible validation field names stable
|
// Use JSON tags to keep client-visible validation field names stable
|
||||||
engine.RegisterTagNameFunc(func(field reflect.StructField) string {
|
engine.RegisterTagNameFunc(func(field reflect.StructField) string {
|
||||||
name := strings.SplitN(field.Tag.Get("json"), ",", 2)[0]
|
name, _, _ := strings.Cut(field.Tag.Get("json"), ",")
|
||||||
if name == "" || name == "-" {
|
if name == "" || name == "-" {
|
||||||
return field.Name
|
return field.Name
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ func validateCallbackURLPatternURL(pattern string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func callbackURLPatternForURLParse(pattern string) string {
|
func callbackURLPatternForURLParse(pattern string) string {
|
||||||
if strings.HasPrefix(pattern, "*://") {
|
if after, ok := strings.CutPrefix(pattern, "*://"); ok {
|
||||||
pattern = "https://" + strings.TrimPrefix(pattern, "*://")
|
pattern = "https://" + after
|
||||||
}
|
}
|
||||||
|
|
||||||
scheme, rest, ok := strings.Cut(pattern, "://")
|
scheme, rest, ok := strings.Cut(pattern, "://")
|
||||||
|
|||||||
@@ -37,14 +37,15 @@ func BuildFormPostCSP(nonce, redirectURI, scriptHash string) string {
|
|||||||
|
|
||||||
func buildCSP(nonce string, formActionExtra, scriptSrcExtra []string) string {
|
func buildCSP(nonce string, formActionExtra, scriptSrcExtra []string) string {
|
||||||
formAction := "'self'"
|
formAction := "'self'"
|
||||||
scriptSrc := "script-src 'self'"
|
var scriptSrc strings.Builder
|
||||||
|
scriptSrc.WriteString("script-src 'self'")
|
||||||
if nonce != "" {
|
if nonce != "" {
|
||||||
scriptSrc += " 'nonce-" + nonce + "'"
|
scriptSrc.WriteString(" 'nonce-" + nonce + "'")
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, extra := range scriptSrcExtra {
|
for _, extra := range scriptSrcExtra {
|
||||||
if extra != "" {
|
if extra != "" {
|
||||||
scriptSrc += " " + extra
|
scriptSrc.WriteString(" " + extra)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ func buildCSP(nonce string, formActionExtra, scriptSrcExtra []string) string {
|
|||||||
"img-src * blob:;" +
|
"img-src * blob:;" +
|
||||||
"font-src 'self'; " +
|
"font-src 'self'; " +
|
||||||
"style-src 'self' 'unsafe-inline'; " +
|
"style-src 'self' 'unsafe-inline'; " +
|
||||||
scriptSrc
|
scriptSrc.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GenerateCSPNonce returns a random base64 nonce for use in a CSP header.
|
// GenerateCSPNonce returns a random base64 nonce for use in a CSP header.
|
||||||
|
|||||||
Reference in New Issue
Block a user