This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
/
o_auth2_resource_server.go
56 lines (44 loc) · 1.9 KB
/
o_auth2_resource_server.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
// Code generated by mockery v1.0.1. DO NOT EDIT.
package mocks
import (
context "context"
interfaces "github.com/flyteorg/flyteadmin/auth/interfaces"
mock "github.com/stretchr/testify/mock"
)
// OAuth2ResourceServer is an autogenerated mock type for the OAuth2ResourceServer type
type OAuth2ResourceServer struct {
mock.Mock
}
type OAuth2ResourceServer_ValidateAccessToken struct {
*mock.Call
}
func (_m OAuth2ResourceServer_ValidateAccessToken) Return(_a0 interfaces.IdentityContext, _a1 error) *OAuth2ResourceServer_ValidateAccessToken {
return &OAuth2ResourceServer_ValidateAccessToken{Call: _m.Call.Return(_a0, _a1)}
}
func (_m *OAuth2ResourceServer) OnValidateAccessToken(ctx context.Context, expectedAudience string, tokenStr string) *OAuth2ResourceServer_ValidateAccessToken {
c_call := _m.On("ValidateAccessToken", ctx, expectedAudience, tokenStr)
return &OAuth2ResourceServer_ValidateAccessToken{Call: c_call}
}
func (_m *OAuth2ResourceServer) OnValidateAccessTokenMatch(matchers ...interface{}) *OAuth2ResourceServer_ValidateAccessToken {
c_call := _m.On("ValidateAccessToken", matchers...)
return &OAuth2ResourceServer_ValidateAccessToken{Call: c_call}
}
// ValidateAccessToken provides a mock function with given fields: ctx, expectedAudience, tokenStr
func (_m *OAuth2ResourceServer) ValidateAccessToken(ctx context.Context, expectedAudience string, tokenStr string) (interfaces.IdentityContext, error) {
ret := _m.Called(ctx, expectedAudience, tokenStr)
var r0 interfaces.IdentityContext
if rf, ok := ret.Get(0).(func(context.Context, string, string) interfaces.IdentityContext); ok {
r0 = rf(ctx, expectedAudience, tokenStr)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(interfaces.IdentityContext)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = rf(ctx, expectedAudience, tokenStr)
} else {
r1 = ret.Error(1)
}
return r0, r1
}