consentsapi

package
v0.9.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package consentsapi contains a service manages user's remembered consent

Index

Constants

This section is empty.

Variables

View Source
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

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

MockListConsents lists the consents.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL