Files
tasks/common/authorization/audience_mapper_mock.go
Travis McChesneyandGitHub e8a75c57b5 Add audience configuration and wire up to JWT audience validation (#8067)
## What changed?
An Audience configuration was added and wired into the server using
.WithAudienceGetter() so that if an audience is configured, it will be
validated against the audience in the JWT.

## Why?
The JWT audience should almost always be validated against an expected
audience value to ensure JWT validity.

## How did you test it?
- [x] built
- [x] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)
2025-09-02 10:50:36 -07:00

57 lines
1.7 KiB
Go

// Code generated by MockGen. DO NOT EDIT.
// Source: audience_mapper.go
//
// Generated by this command:
//
// mockgen -package authorization -source audience_mapper.go -destination audience_mapper_mock.go
//
// Package authorization is a generated GoMock package.
package authorization
import (
reflect "reflect"
context "context"
gomock "go.uber.org/mock/gomock"
grpc "google.golang.org/grpc"
)
// MockJWTAudienceMapper is a mock of JWTAudienceMapper interface.
type MockJWTAudienceMapper struct {
ctrl *gomock.Controller
recorder *MockJWTAudienceMapperMockRecorder
isgomock struct{}
}
// MockJWTAudienceMapperMockRecorder is the mock recorder for MockJWTAudienceMapper.
type MockJWTAudienceMapperMockRecorder struct {
mock *MockJWTAudienceMapper
}
// NewMockJWTAudienceMapper creates a new mock instance.
func NewMockJWTAudienceMapper(ctrl *gomock.Controller) *MockJWTAudienceMapper {
mock := &MockJWTAudienceMapper{ctrl: ctrl}
mock.recorder = &MockJWTAudienceMapperMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockJWTAudienceMapper) EXPECT() *MockJWTAudienceMapperMockRecorder {
return m.recorder
}
// Audience mocks base method.
func (m *MockJWTAudienceMapper) Audience(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo) string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Audience", ctx, req, info)
ret0, _ := ret[0].(string)
return ret0
}
// Audience indicates an expected call of Audience.
func (mr *MockJWTAudienceMapperMockRecorder) Audience(ctx, req, info interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Audience", reflect.TypeOf((*MockJWTAudienceMapper)(nil).Audience), ctx, req, info)
}