Skip to content

Commit

Permalink
feat(go-1.23): Update version (#116)
Browse files Browse the repository at this point in the history
Update go version to 1.23
Update golangci-lint to 1.60.1

Co-authored-by: ldebruijn <[email protected]>
  • Loading branch information
ldebruijn and ldebruijn authored Aug 16, 2024
1 parent ebd5622 commit bd964ce
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: '1.23'

- name: Build
run: make VERSION=${{ github.event.release.tag_name }} build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'

- name: Build
run: make build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.55.2
version: v1.60.1

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG VERSION
ARG REVISION

LABEL org.opencontainers.image.title=graphql-protect \
org.opencontainers.image.description="A dead-simple yet highly customizable security sidecar compatible with any HTTP GraphQL Server or Gateway." \
org.opencontainers.image.description="A dead-simple yet highly customizable security proxy compatible with any HTTP GraphQL Server or Gateway." \
org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.authors=ldebruijn \
org.opencontainers.image.url=https://github.com/ldebruijn/graphql-protect \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GraphQL Protect 🛡️

GraphQL Protect is dead-simple yet highly customizable security sidecar compatible with any HTTP GraphQL Server or Gateway.
GraphQL Protect is dead-simple yet highly customizable security proxy compatible with any HTTP GraphQL Server or Gateway.

![GraphQL Protect Banner](docs/assets/banner.jpeg?raw=true)

Expand Down
2 changes: 1 addition & 1 deletion docs/run/docker.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Docker

GraphQL Protect is intended to run as sidecar to your main application. This allows it to scale with your application, and enjoys the benefit of loopback networking.
GraphQL Protect is intended to run as proxy to your main application. This allows it to scale with your application, and enjoys the benefit of loopback networking.

## Setting up

Expand Down
2 changes: 1 addition & 1 deletion docs/run/kubernetes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Kubernetes

GraphQL Protect is intended to run as sidecar to your main application. This allows it to scale with your application, and enjoys the benefit of loopback networking.
GraphQL Protect is intended to run as proxy to your main application. This allows it to scale with your application, and enjoys the benefit of loopback networking.

## Deployment resource

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ldebruijn/graphql-protect

go 1.22.0
go 1.23.0

require (
cloud.google.com/go/storage v1.43.0
Expand Down
2 changes: 1 addition & 1 deletion internal/business/protect/protect.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewGraphQLProtect(log *slog.Logger, cfg *config.Config, po *persistedoperat
maxBatch, err := batch.NewMaxBatch(cfg.MaxBatch)
accessLogging := accesslogging.NewAccessLogging(cfg.AccessLogging, log)
if err != nil {
log.Warn("Error initializing maximum batch protection", err)
log.Warn("Error initializing maximum batch protection", "err", err)
}

enforcePostMethod := enforce_post.EnforcePostMethod(cfg.EnforcePost)
Expand Down
4 changes: 1 addition & 3 deletions internal/business/rules/aliases/aliases.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package aliases

import (
"fmt"
"github.com/prometheus/client_golang/prometheus"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/validator"
Expand Down Expand Up @@ -50,9 +49,8 @@ func NewMaxAliasesRule(cfg Config) {

if aliases > cfg.Max {
if cfg.RejectOnFailure {
err := fmt.Sprintf("syntax error: Aliases limit of %d exceeded, found %d", cfg.Max, aliases)
addError(
validator.Message(err),
validator.Message("syntax error: Aliases limit of %d exceeded, found %d", cfg.Max, aliases),
validator.At(operation.Position),
)
resultCounter.WithLabelValues("rejected").Inc()
Expand Down
4 changes: 1 addition & 3 deletions internal/business/rules/max_depth/max_depth.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package max_depth // nolint:revive

import (
"fmt"
"github.com/prometheus/client_golang/prometheus"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/validator"
Expand Down Expand Up @@ -34,9 +33,8 @@ func NewMaxDepthRule(cfg Config) {

if maxDepth > cfg.Max {
if cfg.RejectOnFailure {
err := fmt.Sprintf("syntax error: Depth limit of %d exceeded, found %d", cfg.Max, maxDepth)
addError(
validator.Message(err),
validator.Message("syntax error: Depth limit of %d exceeded, found %d", cfg.Max, maxDepth),
validator.At(operation.Position),
)
resultCounter.WithLabelValues("rejected").Inc()
Expand Down
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ LDFLAGS += -s -w
.PHONY: dev.setup
dev.setup:
go mod tidy
go install github.com/golangci/golangci-lint/cmd/[email protected]

.PHONY: build
build:
Expand Down

0 comments on commit bd964ce

Please sign in to comment.