Documentation
¶
Index ¶
- type CreatePolicyRequest
- type CreatePolicyResponse
- type CreateSessionInput
- type PolicyURISet
- type PolicyVerifier
- type RegisterResourceInput
- type RegisterResourceOutput
- type RegisterResourceValue
- type Service
- func (s Service) CreateAccessContext(ctx context.Context) (*StoredAccessContext, error)
- func (s Service) CreatePolicy(ctx context.Context, request CreatePolicyRequest) (*CreatePolicyResponse, error)
- func (s Service) CreateSession(ctx context.Context, request CreateSessionInput) (*StoredSession, error)
- func (s Service) RegisterResource(ctx context.Context, request RegisterResourceInput) (*RegisterResourceOutput, error)
- func (s Service) Status() framework.Status
- func (s Service) Type() framework.Type
- func (s Service) VerifySession(ctx context.Context, request VerifySessionInput) (*VerifySessionOutput, error)
- type ServiceFactory
- type Storage
- func (s *Storage) CheckAccessContextExists(ctx context.Context, id string) (bool, error)
- func (s *Storage) GetAccessContext(ctx context.Context, id string) (*StoredAccessContext, error)
- func (s *Storage) GetSession(ctx context.Context, id string) (*StoredSession, error)
- func (s *Storage) InsertAccessContext(ctx context.Context, access StoredAccessContext) error
- func (s *Storage) InsertSession(ctx context.Context, session StoredSession) error
- type StoredAccessContext
- type StoredSession
- type VerifySessionInput
- type VerifySessionOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreatePolicyRequest ¶
type CreatePolicyRequest struct { PresentationDefinitionID *model.GetPresentationDefinitionRequest `json:"presentation_definition_id"` Verifier PolicyVerifier `json:"verifier"` }
func (CreatePolicyRequest) IsValid ¶
func (cpr CreatePolicyRequest) IsValid() bool
type CreatePolicyResponse ¶
type CreatePolicyResponse struct { // Address of the created policy contract PolicyContract string `json:"policy_contract"` URIs PolicyURISet `json:"uris"` }
type CreateSessionInput ¶
type CreateSessionInput struct {
SessionJWE []byte `json:"jwe,omitempty" validate:"required"`
}
func (CreateSessionInput) IsValid ¶
func (in CreateSessionInput) IsValid() bool
type PolicyURISet ¶
type PolicyVerifier ¶
type RegisterResourceInput ¶
type RegisterResourceInput struct { Role string `json:"role"` PolicyContract string `json:"policy_contract"` Resource string `json:"resource"` }
func (RegisterResourceInput) IsValid ¶
func (in RegisterResourceInput) IsValid() bool
type RegisterResourceOutput ¶
type RegisterResourceValue ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewAccessControlService ¶
func NewAccessControlService(config config.AuthServiceConfig, s storage.ServiceStorage, p *presentation.Service, r resolution.Resolver, k *keystore.Service, rpcService *rpc.Service, ipfsClient *shell.Shell) (*Service, error)
func (Service) CreateAccessContext ¶
func (s Service) CreateAccessContext(ctx context.Context) (*StoredAccessContext, error)
CreateAccessContext creates an access context
func (Service) CreatePolicy ¶
func (s Service) CreatePolicy(ctx context.Context, request CreatePolicyRequest) (*CreatePolicyResponse, error)
CreatePolicy uploads required policy artifacts to ipfs and deploys and registers an access policy on-chain.
func (Service) CreateSession ¶
func (s Service) CreateSession(ctx context.Context, request CreateSessionInput) (*StoredSession, error)
CreateSession houses the main service logic for session token storage. It accepts only requests from trusted parties that are indexing the blockchain state, validates the input, and stores a session entry.
func (Service) RegisterResource ¶
func (s Service) RegisterResource(ctx context.Context, request RegisterResourceInput) (*RegisterResourceOutput, error)
RegisterResource registers a resource on-chain
func (Service) VerifySession ¶
func (s Service) VerifySession(ctx context.Context, request VerifySessionInput) (*VerifySessionOutput, error)
type ServiceFactory ¶
func NewAccessControlServiceFactory ¶
func NewAccessControlServiceFactory(s storage.ServiceStorage, p *presentation.Service, r resolution.Resolver, k *keystore.Service, encrypter encryption.Encrypter, decrypter encryption.Decrypter, rpcService *rpc.Service, ipfsClient *shell.Shell) ServiceFactory
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewAccessControlStorage ¶
func NewAccessControlStorage(db storage.ServiceStorage, e encryption.Encrypter, d encryption.Decrypter, writer storage.Tx) (*Storage, error)
func (*Storage) CheckAccessContextExists ¶
func (*Storage) GetAccessContext ¶
func (*Storage) GetSession ¶
func (*Storage) InsertAccessContext ¶
func (s *Storage) InsertAccessContext(ctx context.Context, access StoredAccessContext) error
func (*Storage) InsertSession ¶
func (s *Storage) InsertSession(ctx context.Context, session StoredSession) error
type StoredAccessContext ¶
type StoredSession ¶
type StoredSession struct { ID string `json:"id"` SessionJWT keyaccess.JWT `json:"token,omitempty"` Issuer string `json:"issuer"` Audience []string `json:"audience"` Subject string `json:"subject"` CreatedAt time.Time `json:"createdAt"` Revoked bool `json:"revoked"` RevokedAt string `json:"revokedAt"` Expired bool `json:"expired"` ExpiresAt time.Time `json:"expiresAt"` }
type VerifySessionInput ¶
type VerifySessionOutput ¶
Click to show internal directories.
Click to hide internal directories.