-
Notifications
You must be signed in to change notification settings - Fork 51
/
mocktokens.go
129 lines (112 loc) · 4.66 KB
/
mocktokens.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// Code generated by MockGen. DO NOT EDIT.
// Source: controller/pkg/tokens/tokens.go
// Package mocktokens is a generated GoMock package.
package mocktokens
import (
ecdsa "crypto/ecdsa"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
claimsheader "go.aporeto.io/enforcerd/trireme-lib/controller/pkg/claimsheader"
pkiverifier "go.aporeto.io/enforcerd/trireme-lib/controller/pkg/pkiverifier"
secrets "go.aporeto.io/enforcerd/trireme-lib/controller/pkg/secrets"
tokens "go.aporeto.io/enforcerd/trireme-lib/controller/pkg/tokens"
)
// MockTokenEngine is a mock of TokenEngine interface
// nolint
type MockTokenEngine struct {
ctrl *gomock.Controller
recorder *MockTokenEngineMockRecorder
}
// MockTokenEngineMockRecorder is the mock recorder for MockTokenEngine
// nolint
type MockTokenEngineMockRecorder struct {
mock *MockTokenEngine
}
// NewMockTokenEngine creates a new mock instance
// nolint
func NewMockTokenEngine(ctrl *gomock.Controller) *MockTokenEngine {
mock := &MockTokenEngine{ctrl: ctrl}
mock.recorder = &MockTokenEngineMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
// nolint
func (m *MockTokenEngine) EXPECT() *MockTokenEngineMockRecorder {
return m.recorder
}
// CreateAndSign mocks base method
// nolint
func (m *MockTokenEngine) CreateAndSign(isAck bool, claims *tokens.ConnectionClaims, encodedBuf, nonce []byte, claimsHeader *claimsheader.ClaimsHeader, secrets secrets.Secrets) ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CreateAndSign", isAck, claims, encodedBuf, nonce, claimsHeader, secrets)
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CreateAndSign indicates an expected call of CreateAndSign
// nolint
func (mr *MockTokenEngineMockRecorder) CreateAndSign(isAck, claims, encodedBuf, nonce, claimsHeader, secrets interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAndSign", reflect.TypeOf((*MockTokenEngine)(nil).CreateAndSign), isAck, claims, encodedBuf, nonce, claimsHeader, secrets)
}
// DecodeSyn mocks base method
// nolint
func (m *MockTokenEngine) DecodeSyn(isSynAck bool, data []byte, privateKey *ecdsa.PrivateKey, secrets secrets.Secrets, connClaims *tokens.ConnectionClaims) (*claimsheader.ClaimsHeader, []byte, interface{}, *pkiverifier.PKIControllerInfo, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DecodeSyn", isSynAck, data, privateKey, secrets, connClaims)
ret0, _ := ret[0].(*claimsheader.ClaimsHeader)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(interface{})
ret3, _ := ret[3].(*pkiverifier.PKIControllerInfo)
ret4, _ := ret[4].(error)
return ret0, ret1, ret2, ret3, ret4
}
// DecodeSyn indicates an expected call of DecodeSyn
// nolint
func (mr *MockTokenEngineMockRecorder) DecodeSyn(isSynAck, data, privateKey, secrets, connClaims interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DecodeSyn", reflect.TypeOf((*MockTokenEngine)(nil).DecodeSyn), isSynAck, data, privateKey, secrets, connClaims)
}
// DecodeAck mocks base method
// nolint
func (m *MockTokenEngine) DecodeAck(data []byte, connClaims *tokens.ConnectionClaims) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DecodeAck", data, connClaims)
ret0, _ := ret[0].(error)
return ret0
}
// DecodeAck indicates an expected call of DecodeAck
// nolint
func (mr *MockTokenEngineMockRecorder) DecodeAck(data, connClaims interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DecodeAck", reflect.TypeOf((*MockTokenEngine)(nil).DecodeAck), data, connClaims)
}
// Randomize mocks base method
// nolint
func (m *MockTokenEngine) Randomize(arg0, arg1 []byte) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Randomize", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// Randomize indicates an expected call of Randomize
// nolint
func (mr *MockTokenEngineMockRecorder) Randomize(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Randomize", reflect.TypeOf((*MockTokenEngine)(nil).Randomize), arg0, arg1)
}
// Sign mocks base method
// nolint
func (m *MockTokenEngine) Sign(arg0 []byte, arg1 *ecdsa.PrivateKey) ([]byte, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Sign", arg0, arg1)
ret0, _ := ret[0].([]byte)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Sign indicates an expected call of Sign
// nolint
func (mr *MockTokenEngineMockRecorder) Sign(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sign", reflect.TypeOf((*MockTokenEngine)(nil).Sign), arg0, arg1)
}