fix nil pointer in GetTokenIDAndSubjectFromToken
This commit is contained in:
parent
aeda5d7178
commit
f47a37e233
7 changed files with 773 additions and 3 deletions
220
pkg/op/mock/exchanger.mock.go
Normal file
220
pkg/op/mock/exchanger.mock.go
Normal file
|
@ -0,0 +1,220 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/zitadel/oidc/v3/pkg/op (interfaces: Exchanger)
|
||||
|
||||
// Package mock is a generated GoMock package.
|
||||
package mock
|
||||
|
||||
import (
|
||||
context "context"
|
||||
slog "log/slog"
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
http "github.com/zitadel/oidc/v3/pkg/http"
|
||||
op "github.com/zitadel/oidc/v3/pkg/op"
|
||||
)
|
||||
|
||||
// MockExchanger is a mock of Exchanger interface.
|
||||
type MockExchanger struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockExchangerMockRecorder
|
||||
}
|
||||
|
||||
// MockExchangerMockRecorder is the mock recorder for MockExchanger.
|
||||
type MockExchangerMockRecorder struct {
|
||||
mock *MockExchanger
|
||||
}
|
||||
|
||||
// NewMockExchanger creates a new mock instance.
|
||||
func NewMockExchanger(ctrl *gomock.Controller) *MockExchanger {
|
||||
mock := &MockExchanger{ctrl: ctrl}
|
||||
mock.recorder = &MockExchangerMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockExchanger) EXPECT() *MockExchangerMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// AccessTokenVerifier mocks base method.
|
||||
func (m *MockExchanger) AccessTokenVerifier(arg0 context.Context) *op.AccessTokenVerifier {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "AccessTokenVerifier", arg0)
|
||||
ret0, _ := ret[0].(*op.AccessTokenVerifier)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// AccessTokenVerifier indicates an expected call of AccessTokenVerifier.
|
||||
func (mr *MockExchangerMockRecorder) AccessTokenVerifier(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AccessTokenVerifier", reflect.TypeOf((*MockExchanger)(nil).AccessTokenVerifier), arg0)
|
||||
}
|
||||
|
||||
// AuthMethodPostSupported mocks base method.
|
||||
func (m *MockExchanger) AuthMethodPostSupported() bool {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "AuthMethodPostSupported")
|
||||
ret0, _ := ret[0].(bool)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// AuthMethodPostSupported indicates an expected call of AuthMethodPostSupported.
|
||||
func (mr *MockExchangerMockRecorder) AuthMethodPostSupported() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthMethodPostSupported", reflect.TypeOf((*MockExchanger)(nil).AuthMethodPostSupported))
|
||||
}
|
||||
|
||||
// AuthMethodPrivateKeyJWTSupported mocks base method.
|
||||
func (m *MockExchanger) AuthMethodPrivateKeyJWTSupported() bool {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "AuthMethodPrivateKeyJWTSupported")
|
||||
ret0, _ := ret[0].(bool)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// AuthMethodPrivateKeyJWTSupported indicates an expected call of AuthMethodPrivateKeyJWTSupported.
|
||||
func (mr *MockExchangerMockRecorder) AuthMethodPrivateKeyJWTSupported() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthMethodPrivateKeyJWTSupported", reflect.TypeOf((*MockExchanger)(nil).AuthMethodPrivateKeyJWTSupported))
|
||||
}
|
||||
|
||||
// Crypto mocks base method.
|
||||
func (m *MockExchanger) Crypto() op.Crypto {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Crypto")
|
||||
ret0, _ := ret[0].(op.Crypto)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Crypto indicates an expected call of Crypto.
|
||||
func (mr *MockExchangerMockRecorder) Crypto() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Crypto", reflect.TypeOf((*MockExchanger)(nil).Crypto))
|
||||
}
|
||||
|
||||
// Decoder mocks base method.
|
||||
func (m *MockExchanger) Decoder() http.Decoder {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Decoder")
|
||||
ret0, _ := ret[0].(http.Decoder)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Decoder indicates an expected call of Decoder.
|
||||
func (mr *MockExchangerMockRecorder) Decoder() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Decoder", reflect.TypeOf((*MockExchanger)(nil).Decoder))
|
||||
}
|
||||
|
||||
// GrantTypeClientCredentialsSupported mocks base method.
|
||||
func (m *MockExchanger) GrantTypeClientCredentialsSupported() bool {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GrantTypeClientCredentialsSupported")
|
||||
ret0, _ := ret[0].(bool)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GrantTypeClientCredentialsSupported indicates an expected call of GrantTypeClientCredentialsSupported.
|
||||
func (mr *MockExchangerMockRecorder) GrantTypeClientCredentialsSupported() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantTypeClientCredentialsSupported", reflect.TypeOf((*MockExchanger)(nil).GrantTypeClientCredentialsSupported))
|
||||
}
|
||||
|
||||
// GrantTypeDeviceCodeSupported mocks base method.
|
||||
func (m *MockExchanger) GrantTypeDeviceCodeSupported() bool {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GrantTypeDeviceCodeSupported")
|
||||
ret0, _ := ret[0].(bool)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GrantTypeDeviceCodeSupported indicates an expected call of GrantTypeDeviceCodeSupported.
|
||||
func (mr *MockExchangerMockRecorder) GrantTypeDeviceCodeSupported() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantTypeDeviceCodeSupported", reflect.TypeOf((*MockExchanger)(nil).GrantTypeDeviceCodeSupported))
|
||||
}
|
||||
|
||||
// GrantTypeJWTAuthorizationSupported mocks base method.
|
||||
func (m *MockExchanger) GrantTypeJWTAuthorizationSupported() bool {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GrantTypeJWTAuthorizationSupported")
|
||||
ret0, _ := ret[0].(bool)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GrantTypeJWTAuthorizationSupported indicates an expected call of GrantTypeJWTAuthorizationSupported.
|
||||
func (mr *MockExchangerMockRecorder) GrantTypeJWTAuthorizationSupported() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantTypeJWTAuthorizationSupported", reflect.TypeOf((*MockExchanger)(nil).GrantTypeJWTAuthorizationSupported))
|
||||
}
|
||||
|
||||
// GrantTypeRefreshTokenSupported mocks base method.
|
||||
func (m *MockExchanger) GrantTypeRefreshTokenSupported() bool {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GrantTypeRefreshTokenSupported")
|
||||
ret0, _ := ret[0].(bool)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GrantTypeRefreshTokenSupported indicates an expected call of GrantTypeRefreshTokenSupported.
|
||||
func (mr *MockExchangerMockRecorder) GrantTypeRefreshTokenSupported() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantTypeRefreshTokenSupported", reflect.TypeOf((*MockExchanger)(nil).GrantTypeRefreshTokenSupported))
|
||||
}
|
||||
|
||||
// GrantTypeTokenExchangeSupported mocks base method.
|
||||
func (m *MockExchanger) GrantTypeTokenExchangeSupported() bool {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GrantTypeTokenExchangeSupported")
|
||||
ret0, _ := ret[0].(bool)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GrantTypeTokenExchangeSupported indicates an expected call of GrantTypeTokenExchangeSupported.
|
||||
func (mr *MockExchangerMockRecorder) GrantTypeTokenExchangeSupported() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantTypeTokenExchangeSupported", reflect.TypeOf((*MockExchanger)(nil).GrantTypeTokenExchangeSupported))
|
||||
}
|
||||
|
||||
// IDTokenHintVerifier mocks base method.
|
||||
func (m *MockExchanger) IDTokenHintVerifier(arg0 context.Context) *op.IDTokenHintVerifier {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "IDTokenHintVerifier", arg0)
|
||||
ret0, _ := ret[0].(*op.IDTokenHintVerifier)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// IDTokenHintVerifier indicates an expected call of IDTokenHintVerifier.
|
||||
func (mr *MockExchangerMockRecorder) IDTokenHintVerifier(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IDTokenHintVerifier", reflect.TypeOf((*MockExchanger)(nil).IDTokenHintVerifier), arg0)
|
||||
}
|
||||
|
||||
// Logger mocks base method.
|
||||
func (m *MockExchanger) Logger() *slog.Logger {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Logger")
|
||||
ret0, _ := ret[0].(*slog.Logger)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Logger indicates an expected call of Logger.
|
||||
func (mr *MockExchangerMockRecorder) Logger() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Logger", reflect.TypeOf((*MockExchanger)(nil).Logger))
|
||||
}
|
||||
|
||||
// Storage mocks base method.
|
||||
func (m *MockExchanger) Storage() op.Storage {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Storage")
|
||||
ret0, _ := ret[0].(op.Storage)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Storage indicates an expected call of Storage.
|
||||
func (mr *MockExchangerMockRecorder) Storage() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Storage", reflect.TypeOf((*MockExchanger)(nil).Storage))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue