Documentation ¶
Index ¶
- func ID() string
- type Consent
- type EndorsementInfo
- type PermissionCategory
- type RejectionInfo
- type ServerV2
- func (s ServerV2) ConsentV2(ctx context.Context, request api.ConsentV2RequestObject) (api.ConsentV2ResponseObject, error)
- func (s ServerV2) CreateConsentV2(ctx context.Context, request api.CreateConsentV2RequestObject) (api.CreateConsentV2ResponseObject, error)
- func (s ServerV2) DeleteConsentV2(ctx context.Context, request api.DeleteConsentV2RequestObject) (api.DeleteConsentV2ResponseObject, error)
- type Service
- func (s Service) Authorize(ctx context.Context, id string, permissions ...api.ConsentPermission) error
- func (s Service) Fetch(ctx context.Context, meta api.RequestMeta, id string) (Consent, error)
- func (s Service) FetchAndConsume(ctx context.Context, meta api.RequestMeta, id string) (Consent, error)
- func (s Service) Reject(ctx context.Context, meta api.RequestMeta, id string, info RejectionInfo) error
- func (s Service) Verify(ctx context.Context, meta api.RequestMeta, id string, ...) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Consent ¶
type Consent struct { ID string `bson:"_id"` Status api.ConsentStatus `bson:"status"` UserCPF string `bson:"user_cpf"` BusinessCNPJ string `bson:"business_cnpj,omitempty"` ClientId string `bson:"client_id"` Permissions []api.ConsentPermission `bson:"permissions"` CreatedAt time.Time `bson:"created_at"` UpdatedAt time.Time `bson:"updated_at"` ExpiresAt time.Time `bson:"expires_at"` RejectionInfo *RejectionInfo `bson:"rejection,omitempty"` Data api.ConsentData `json:"data"` }
func (Consent) HasAuthExpired ¶
HasAuthExpired returns true if the status is [StatusAwaitingAuthorisation] and the max time awaiting authorization has elapsed.
func (Consent) HasPermissions ¶
func (c Consent) HasPermissions(permissions []api.ConsentPermission) bool
func (Consent) IsAuthorized ¶
func (Consent) IsAwaitingAuthorization ¶
type EndorsementInfo ¶
type EndorsementInfo struct { PolicyNumber string `bson:"policy_number"` Type api.EndorsementType `bson:"type"` Description string `bson:"description"` }
type PermissionCategory ¶
type PermissionCategory []api.ConsentPermission
type RejectionInfo ¶
type RejectionInfo struct { RejectedBy api.ConsentRejectedBy `bson:"rejected_by"` Reason api.ConsentRejectedReasonCode `bson:"reason"` }
type ServerV2 ¶
type ServerV2 struct {
// contains filtered or unexported fields
}
func NewServerV2 ¶
func (ServerV2) ConsentV2 ¶
func (s ServerV2) ConsentV2( ctx context.Context, request api.ConsentV2RequestObject, ) ( api.ConsentV2ResponseObject, error, )
func (ServerV2) CreateConsentV2 ¶
func (s ServerV2) CreateConsentV2( ctx context.Context, request api.CreateConsentV2RequestObject, ) ( api.CreateConsentV2ResponseObject, error, )
func (ServerV2) DeleteConsentV2 ¶
func (s ServerV2) DeleteConsentV2( ctx context.Context, request api.DeleteConsentV2RequestObject, ) ( api.DeleteConsentV2ResponseObject, error, )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.