Documentation
¶
Overview ¶
Package consentsapi contains a service manages user's remembered consent
Index ¶
- Variables
- func DeleteConsentFactory(serv *Service, consentPath string, consentIDUseUUID bool) *handlerfactory.Options
- func ListConsentsFactory(serv *Service, consentsPath string) *handlerfactory.Options
- type MockConsentsHandler
- type Service
- type StubConsents
- func (s *StubConsents) DeleteConsent(_ context.Context, req *cpb.DeleteConsentRequest) (*epb.Empty, error)
- func (s *StubConsents) ListConsents(_ context.Context, req *cpb.ListConsentsRequest) (*cpb.ListConsentsResponse, error)
- func (s *StubConsents) MockDeleteConsent(_ context.Context, req *cpb.DeleteConsentRequest) (*epb.Empty, error)
- func (s *StubConsents) MockListConsents(_ context.Context, req *cpb.ListConsentsRequest) (*cpb.MockListConsentsResponse, error)
Constants ¶
This section is empty.
Variables ¶
var FakeConsent = &cpb.MockConsent{ Name: "consents/fake-consent", User: "fake-user", Client: "fake-client", Items: []string{"fake-visa-1", "fake-visa-2", "fake-visa-3"}, Scopes: []string{"fake-scope-1", "fake-scope-2"}, Resouces: []string{"fake-resource-1", "fake-resource-2"}, CreateTime: ptypes.TimestampNow(), UpdateTime: ptypes.TimestampNow(), }
FakeConsent is a fake consent. TODO: move these fakes to test file once implemented.
Functions ¶
func DeleteConsentFactory ¶ added in v0.9.2
func DeleteConsentFactory(serv *Service, consentPath string, consentIDUseUUID bool) *handlerfactory.Options
DeleteConsentFactory http handler for "/identity/v1alpha/{realm}/users/{user}/consents/{consent_id}"
func ListConsentsFactory ¶ added in v0.9.2
func ListConsentsFactory(serv *Service, consentsPath string) *handlerfactory.Options
ListConsentsFactory http handler for "/identity/v1alpha/{realm}/users/{user}/consents"
Types ¶
type MockConsentsHandler ¶ added in v0.8.9
type MockConsentsHandler struct {
// contains filtered or unexported fields
}
MockConsentsHandler is a HTTP handler wrapping a GRPC server.
func NewMockConsentsHandler ¶ added in v0.8.9
func NewMockConsentsHandler(s tgpb.ConsentsServer) *MockConsentsHandler
NewMockConsentsHandler returns a new MockConsentsHandler.
func (*MockConsentsHandler) DeleteConsent ¶ added in v0.8.9
func (h *MockConsentsHandler) DeleteConsent(w http.ResponseWriter, r *http.Request)
DeleteConsent handles DeleteConsent HTTP requests.
func (*MockConsentsHandler) ListConsents ¶ added in v0.8.9
func (h *MockConsentsHandler) ListConsents(w http.ResponseWriter, r *http.Request)
ListConsents handles ListConsents HTTP requests.
type Service ¶ added in v0.9.2
type Service struct { Store storage.Store Clients func(tx storage.Tx) (map[string]*cpb.Client, error) }
Service contains store and funcs to access data.
type StubConsents ¶
type StubConsents struct {
Consent *cpb.MockConsent
}
StubConsents is a stub implementation.
func (*StubConsents) DeleteConsent ¶
func (s *StubConsents) DeleteConsent(_ context.Context, req *cpb.DeleteConsentRequest) (*epb.Empty, error)
DeleteConsent revokes a consent.
func (*StubConsents) ListConsents ¶
func (s *StubConsents) ListConsents(_ context.Context, req *cpb.ListConsentsRequest) (*cpb.ListConsentsResponse, error)
ListConsents lists the consents.
func (*StubConsents) MockDeleteConsent ¶ added in v0.8.9
func (s *StubConsents) MockDeleteConsent(_ context.Context, req *cpb.DeleteConsentRequest) (*epb.Empty, error)
MockDeleteConsent revokes a consent.
func (*StubConsents) MockListConsents ¶ added in v0.8.9
func (s *StubConsents) MockListConsents(_ context.Context, req *cpb.ListConsentsRequest) (*cpb.MockListConsentsResponse, error)
MockListConsents lists the consents.