fix nil pointer in GetTokenIDAndSubjectFromToken

This commit is contained in:
Fotkurz 2025-03-26 05:18:34 -03:00
parent aeda5d7178
commit f47a37e233
7 changed files with 773 additions and 3 deletions

View file

@ -0,0 +1,131 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/zitadel/oidc/v3/pkg/op (interfaces: RefreshTokenRequest)
// Package mock is a generated GoMock package.
package mock
import (
reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
)
// MockRefreshTokenRequest is a mock of RefreshTokenRequest interface.
type MockRefreshTokenRequest struct {
ctrl *gomock.Controller
recorder *MockRefreshTokenRequestMockRecorder
}
// MockRefreshTokenRequestMockRecorder is the mock recorder for MockRefreshTokenRequest.
type MockRefreshTokenRequestMockRecorder struct {
mock *MockRefreshTokenRequest
}
// NewMockRefreshTokenRequest creates a new mock instance.
func NewMockRefreshTokenRequest(ctrl *gomock.Controller) *MockRefreshTokenRequest {
mock := &MockRefreshTokenRequest{ctrl: ctrl}
mock.recorder = &MockRefreshTokenRequestMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockRefreshTokenRequest) EXPECT() *MockRefreshTokenRequestMockRecorder {
return m.recorder
}
// GetAMR mocks base method.
func (m *MockRefreshTokenRequest) GetAMR() []string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAMR")
ret0, _ := ret[0].([]string)
return ret0
}
// GetAMR indicates an expected call of GetAMR.
func (mr *MockRefreshTokenRequestMockRecorder) GetAMR() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAMR", reflect.TypeOf((*MockRefreshTokenRequest)(nil).GetAMR))
}
// GetAudience mocks base method.
func (m *MockRefreshTokenRequest) GetAudience() []string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAudience")
ret0, _ := ret[0].([]string)
return ret0
}
// GetAudience indicates an expected call of GetAudience.
func (mr *MockRefreshTokenRequestMockRecorder) GetAudience() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAudience", reflect.TypeOf((*MockRefreshTokenRequest)(nil).GetAudience))
}
// GetAuthTime mocks base method.
func (m *MockRefreshTokenRequest) GetAuthTime() time.Time {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAuthTime")
ret0, _ := ret[0].(time.Time)
return ret0
}
// GetAuthTime indicates an expected call of GetAuthTime.
func (mr *MockRefreshTokenRequestMockRecorder) GetAuthTime() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthTime", reflect.TypeOf((*MockRefreshTokenRequest)(nil).GetAuthTime))
}
// GetClientID mocks base method.
func (m *MockRefreshTokenRequest) GetClientID() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetClientID")
ret0, _ := ret[0].(string)
return ret0
}
// GetClientID indicates an expected call of GetClientID.
func (mr *MockRefreshTokenRequestMockRecorder) GetClientID() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClientID", reflect.TypeOf((*MockRefreshTokenRequest)(nil).GetClientID))
}
// GetScopes mocks base method.
func (m *MockRefreshTokenRequest) GetScopes() []string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetScopes")
ret0, _ := ret[0].([]string)
return ret0
}
// GetScopes indicates an expected call of GetScopes.
func (mr *MockRefreshTokenRequestMockRecorder) GetScopes() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetScopes", reflect.TypeOf((*MockRefreshTokenRequest)(nil).GetScopes))
}
// GetSubject mocks base method.
func (m *MockRefreshTokenRequest) GetSubject() string {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetSubject")
ret0, _ := ret[0].(string)
return ret0
}
// GetSubject indicates an expected call of GetSubject.
func (mr *MockRefreshTokenRequestMockRecorder) GetSubject() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubject", reflect.TypeOf((*MockRefreshTokenRequest)(nil).GetSubject))
}
// SetCurrentScopes mocks base method.
func (m *MockRefreshTokenRequest) SetCurrentScopes(arg0 []string) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetCurrentScopes", arg0)
}
// SetCurrentScopes indicates an expected call of SetCurrentScopes.
func (mr *MockRefreshTokenRequestMockRecorder) SetCurrentScopes(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetCurrentScopes", reflect.TypeOf((*MockRefreshTokenRequest)(nil).SetCurrentScopes), arg0)
}