feat(op): implemented support for client_credentials grant (#172)

* implemented support for client_credentials grant

* first draft

* Update pkg/op/token_client_credentials.go

Co-authored-by: Livio Amstutz <livio.a@gmail.com>

* updated placeholder interface name

* updated import paths

* ran mockgen

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
James Batt 2022-05-09 23:06:54 +10:00 committed by GitHub
parent 550f7877f2
commit 86fd502434
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 164 additions and 6 deletions

View file

@ -7,9 +7,9 @@ package mock
import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
http "github.com/zitadel/oidc/pkg/http"
op "github.com/zitadel/oidc/pkg/op"
gomock "github.com/golang/mock/gomock"
)
// MockAuthorizer is a mock of Authorizer interface.

View file

@ -8,9 +8,9 @@ import (
reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
oidc "github.com/zitadel/oidc/pkg/oidc"
op "github.com/zitadel/oidc/pkg/op"
gomock "github.com/golang/mock/gomock"
)
// MockClient is a mock of Client interface.

View file

@ -7,8 +7,8 @@ package mock
import (
reflect "reflect"
op "github.com/zitadel/oidc/pkg/op"
gomock "github.com/golang/mock/gomock"
op "github.com/zitadel/oidc/pkg/op"
language "golang.org/x/text/language"
)
@ -105,6 +105,20 @@ func (mr *MockConfigurationMockRecorder) EndSessionEndpoint() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndSessionEndpoint", reflect.TypeOf((*MockConfiguration)(nil).EndSessionEndpoint))
}
// GrantTypeClientCredentialsSupported mocks base method.
func (m *MockConfiguration) 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 *MockConfigurationMockRecorder) GrantTypeClientCredentialsSupported() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantTypeClientCredentialsSupported", reflect.TypeOf((*MockConfiguration)(nil).GrantTypeClientCredentialsSupported))
}
// GrantTypeJWTAuthorizationSupported mocks base method.
func (m *MockConfiguration) GrantTypeJWTAuthorizationSupported() bool {
m.ctrl.T.Helper()

View file

@ -9,9 +9,9 @@ import (
reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
oidc "github.com/zitadel/oidc/pkg/oidc"
op "github.com/zitadel/oidc/pkg/op"
gomock "github.com/golang/mock/gomock"
jose "gopkg.in/square/go-jose.v2"
)