Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
persist-credentials: false

- name: Set up just
uses: cerbos/actions/install-tools@b65bfbd7621d9a89a06901a7daaed0cfc72eb690 # main
uses: cerbos/actions/install-tools@e0522b0533b6679733f18d606638b0d91ffcf39d # main
with:
tools: just

Expand Down Expand Up @@ -65,18 +65,18 @@ jobs:
go-version-file: go.mod

- name: Set up just
uses: cerbos/actions/install-tools@b65bfbd7621d9a89a06901a7daaed0cfc72eb690 # main
uses: cerbos/actions/install-tools@e0522b0533b6679733f18d606638b0d91ffcf39d # main
with:
tools: just

- name: modernize
run: just lint-modernize

- name: golangci-lint
uses: cerbos/actions/golangci-lint@b65bfbd7621d9a89a06901a7daaed0cfc72eb690 # main
uses: cerbos/actions/golangci-lint@e0522b0533b6679733f18d606638b0d91ffcf39d # main

- name: Check repo status
uses: cerbos/actions/check-repo-status@b65bfbd7621d9a89a06901a7daaed0cfc72eb690 # main
uses: cerbos/actions/check-repo-status@e0522b0533b6679733f18d606638b0d91ffcf39d # main

buf:
name: Proto check
Expand All @@ -90,4 +90,4 @@ jobs:
persist-credentials: false

- name: Lint protos
uses: cerbos/actions/buf@b65bfbd7621d9a89a06901a7daaed0cfc72eb690 # main
uses: cerbos/actions/buf@e0522b0533b6679733f18d606638b0d91ffcf39d # main
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
persist-credentials: false

- name: Push to BSR
uses: cerbos/actions/buf@b65bfbd7621d9a89a06901a7daaed0cfc72eb690 # main
uses: cerbos/actions/buf@e0522b0533b6679733f18d606638b0d91ffcf39d # main
with:
token: ${{ secrets.BUF_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/zizmor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
persist-credentials: false

- name: Run zizmor
uses: cerbos/actions/lint-actions@b65bfbd7621d9a89a06901a7daaed0cfc72eb690 # main
uses: cerbos/actions/lint-actions@e0522b0533b6679733f18d606638b0d91ffcf39d # main
8 changes: 5 additions & 3 deletions test/testserver/testserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ func newHub(t *testing.T, server *httptest.Server, creds *credentials.Credential
return h
}

const expectedAuthToken = "access-token"

type authCheck struct{}

func (ac authCheck) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
return connect.UnaryFunc(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {
if req.Header().Get(base.AuthTokenHeader) != "access-token" {
if req.Header().Get(base.AuthTokenHeader) != expectedAuthToken {
return nil, connect.NewError(connect.CodeUnauthenticated, errors.New("invalid or missing access token"))
}
return next(ctx, req)
Expand All @@ -135,7 +137,7 @@ func (ac authCheck) WrapStreamingClient(next connect.StreamingClientFunc) connec

func (ac authCheck) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
return connect.StreamingHandlerFunc(func(ctx context.Context, conn connect.StreamingHandlerConn) error {
if conn.RequestHeader().Get(base.AuthTokenHeader) != "access-token" {
if conn.RequestHeader().Get(base.AuthTokenHeader) != expectedAuthToken {
return connect.NewError(connect.CodeUnauthenticated, errors.New("invalid or missing access token"))
}

Expand All @@ -149,7 +151,7 @@ func ExpectAPIKeySuccess(t *testing.T, mockAPIKeySvc *mockapikeyv1connect.ApiKey
mockAPIKeySvc.EXPECT().
IssueAccessToken(mock.Anything, mock.MatchedBy(issueAccessTokenRequest())).
Return(connect.NewResponse(&apikeyv1.IssueAccessTokenResponse{
AccessToken: "access-token",
AccessToken: expectedAuthToken,
ExpiresIn: durationpb.New(1 * time.Minute),
}), nil)
}
Expand Down
4 changes: 2 additions & 2 deletions tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.26.2

require (
connectrpc.com/connect v1.19.2
github.com/cerbos/actions v0.0.0-20260505190950-b65bfbd7621d
github.com/cerbos/actions v0.0.0-20260515102558-e0522b0533b6
github.com/cerbos/protoc-gen-go-hashpb v0.5.0
github.com/planetscale/vtprotobuf v0.6.1-0.20250313105119-ba97887b0a25
github.com/vektra/mockery/v3 v3.7.0
Expand Down Expand Up @@ -56,7 +56,7 @@ require (
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect
golang.org/x/mod v0.35.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.43.0 // indirect
golang.org/x/sys v0.44.0 // indirect
golang.org/x/term v0.42.0 // indirect
golang.org/x/text v0.36.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CD
github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY=
github.com/brunoga/deep v1.3.1 h1:bSrL6FhAZa6JlVv4vsi7Hg8SLwroDb1kgDERRVipBCo=
github.com/brunoga/deep v1.3.1/go.mod h1:GDV6dnXqn80ezsLSZ5Wlv1PdKAWAO4L5PnKYtv2dgaI=
github.com/cerbos/actions v0.0.0-20260505190950-b65bfbd7621d h1:a7NijPLthdw2f3DIIY5Wl+ROH9GnJXvOIamfX7a1ZUI=
github.com/cerbos/actions v0.0.0-20260505190950-b65bfbd7621d/go.mod h1:Oez+ZLwg55HZZmPRFCfE54aNL8/zGNl8LJa3KHk4QAY=
github.com/cerbos/actions v0.0.0-20260515102558-e0522b0533b6 h1:wCwPJflxb7n25PTiBVRZA00ucbpysPjlW++BCMJdzf0=
github.com/cerbos/actions v0.0.0-20260515102558-e0522b0533b6/go.mod h1:eExHaISF7LBw4Q0GkGL5Xj8ac6l7V7m910yRnj2Mx4c=
github.com/cerbos/protoc-gen-go-hashpb v0.5.0 h1:eRxAGfPtAPIwuEu/5TwUM//iE2DLxPRv6MYcKTk+Vqg=
github.com/cerbos/protoc-gen-go-hashpb v0.5.0/go.mod h1:2xx4aHivI/LQZA2iusGwPwsg/EOKxRX59BZZbojy2OM=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
Expand Down Expand Up @@ -149,8 +149,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ=
golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY=
Expand Down