Documentation
¶
Index ¶
- Variables
- func Create(ctx context.Context, exec boil.ContextExecutor, redConn *redis.Client, ...) error
- func CreateAccount(ctx context.Context, exec boil.ContextExecutor, account *Account) error
- func HasCrypto(ctx context.Context, exec boil.ContextExecutor, accountID string) (bool, error)
- func NotificationAck(ctx context.Context, exec boil.ContextExecutor, identityID string, ...) error
- func NotificationBulkCreate(ctx context.Context, exec boil.ContextExecutor, redConn *redis.Client, ...) error
- func NotificationCount(ctx context.Context, exec boil.ContextExecutor, filters NotificationFilters) (n int, err error)
- func NotificationCreate(ctx context.Context, exec boil.ContextExecutor, redConn *redis.Client, ...) error
- func NotificationMarkAutoInvitationUsed(ctx context.Context, exec boil.ContextExecutor, cryptoactionID string) error
- func ProfileConfigShare(ctx context.Context, exec boil.ContextExecutor, ...) error
- func ProfileConfigUnshare(ctx context.Context, exec boil.ContextExecutor, ...) error
- func SetIdentityPubkey(ctx context.Context, exec boil.ContextExecutor, identityID string, ...) error
- func Update(ctx context.Context, exec boil.ContextExecutor, identity *Identity) error
- func UpdateAccount(ctx context.Context, exec boil.ContextExecutor, account *Account) error
- type Account
- type AvatarAmazonS3
- type AvatarFile
- type AvatarFileSystem
- type AvatarRepo
- type ConfigProfileView
- type Filters
- type IdentifierKind
- type Identity
- func Get(ctx context.Context, exec boil.ContextExecutor, identityID string) (ret Identity, err error)
- func GetByIdentifier(ctx context.Context, exec boil.ContextExecutor, value string, ...) (ret Identity, err error)
- func List(ctx context.Context, exec boil.ContextExecutor, filters Filters) ([]*Identity, error)
- func Require(ctx context.Context, exec boil.ContextExecutor, redConn *redis.Client, ...) (Identity, error)
- type IdentityPublicKeys
- type IntraprocessHelper
- func (ih IntraprocessHelper) Get(ctx context.Context, identityID string) (Identity, error)
- func (ih IntraprocessHelper) GetByIdentifierValue(ctx context.Context, identifierValue string) (Identity, error)
- func (ih IntraprocessHelper) List(ctx context.Context, filters Filters) ([]*Identity, error)
- func (ih IntraprocessHelper) NotificationBulkCreate(ctx context.Context, identityIDs []string, nType string, details null.JSON) error
- type Notification
- type NotificationFilters
- type ProfileView
- type Service
- type WebauthnIdentity
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Create ¶
func Create(ctx context.Context, exec boil.ContextExecutor, redConn *redis.Client, identity *Identity) error
Create ...
func CreateAccount ¶
CreateAccount ...
func HasCrypto ¶
HasCrypto ...
func NotificationAck ¶
func NotificationAck(ctx context.Context, exec boil.ContextExecutor, identityID string, notifIDs []int) error
NotificationAck acknowledged_at to time.Now() for all unacknowledged notification of the received identity id if notifIds don't belong to the identity id, it will be ignored
func NotificationBulkCreate ¶
func NotificationBulkCreate(ctx context.Context, exec boil.ContextExecutor, redConn *redis.Client, identityIDs []string, nType string, details null.JSON) error
NotificationBulkCreate ...
func NotificationCount ¶
func NotificationCount(ctx context.Context, exec boil.ContextExecutor, filters NotificationFilters) (n int, err error)
NotificationCount unacknowledged notifications for received identity id
func NotificationCreate ¶
func NotificationCreate(ctx context.Context, exec boil.ContextExecutor, redConn *redis.Client, identityID string, nType string, details null.JSON) error
NotificationCreate ...
func NotificationMarkAutoInvitationUsed ¶
func NotificationMarkAutoInvitationUsed(ctx context.Context, exec boil.ContextExecutor, cryptoactionID string) error
NotificationMarkAutoInvitationUsed ...
func ProfileConfigShare ¶
func ProfileConfigShare( ctx context.Context, exec boil.ContextExecutor, identityID, informationType string, ) error
ProfileConfigShare ...
func ProfileConfigUnshare ¶
func ProfileConfigUnshare( ctx context.Context, exec boil.ContextExecutor, identityID, informationType string, ) error
ProfileConfigUnshare ...
func SetIdentityPubkey ¶
func Update ¶
Update ...
Types ¶
type Account ¶
Account ...
type AvatarAmazonS3 ¶
type AvatarAmazonS3 struct {
// contains filtered or unexported fields
}
AvatarAmazonS3 ...
func NewAvatarAmazonS3 ¶
func NewAvatarAmazonS3(region, bucket string) (*AvatarAmazonS3, error)
NewAvatarAmazonS3 init an S3 session
func (*AvatarAmazonS3) Delete ¶
func (s *AvatarAmazonS3) Delete(ctx context.Context, avatar *AvatarFile) error
Delete ...
func (*AvatarAmazonS3) Upload ¶
func (s *AvatarAmazonS3) Upload(ctx context.Context, avatar *AvatarFile) (string, error)
Upload ...
type AvatarFile ¶
AvatarFile ...
type AvatarFileSystem ¶
type AvatarFileSystem struct {
// contains filtered or unexported fields
}
AvatarFileSystem ...
func NewAvatarFileSystem ¶
func NewAvatarFileSystem(avatarLocation, avatarURL string) *AvatarFileSystem
NewAvatarFileSystem constructor /!\ NOT SAFE TO USE IN PRODUCTION
func (*AvatarFileSystem) Delete ¶
func (fs *AvatarFileSystem) Delete(ctx context.Context, avatar *AvatarFile) error
Delete an avatar from the file system
func (*AvatarFileSystem) Upload ¶
func (fs *AvatarFileSystem) Upload(ctx context.Context, avatar *AvatarFile) (string, error)
Upload an avatar in file system directory and return its path
type AvatarRepo ¶
type AvatarRepo interface { Upload(context.Context, *AvatarFile) (string, error) Delete(context.Context, *AvatarFile) error }
AvatarRepo ...
type ConfigProfileView ¶
type ConfigProfileView struct {
Email bool `json:"email"`
}
ConfigProfileView ...
func ProfileConfigGet ¶
func ProfileConfigGet(ctx context.Context, exec boil.ContextExecutor, identityID string) (c ConfigProfileView, err error)
ProfileConfigGet ...
type Filters ¶
type Filters struct { IdentifierValue null.String IdentifierKind null.String IDs []string AccountID null.String }
Filters ...
type IdentifierKind ¶
type IdentifierKind string
IdentifierKind ...
const ( // EmailIdentifier ... AnyIdentifierKind IdentifierKind = "any" IdentifierKindEmail IdentifierKind = "email" IdentifierKindOrgID IdentifierKind = "org_id" )
type Identity ¶
type Identity struct { ID string `json:"id"` AccountID string `json:"account_id"` IdentifierValue string `json:"identifier_value"` IdentifierKind IdentifierKind `json:"identifier_kind"` DisplayName string `json:"display_name"` Notifications string `json:"notifications"` AvatarURL null.String `json:"avatar_url"` Color null.String `json:"color"` Level int `json:"level"` MFAMethod string `json:"mfa_method"` IdentityPublicKeys }
Identity ...
func Get ¶
func Get(ctx context.Context, exec boil.ContextExecutor, identityID string) (ret Identity, err error)
Get ...
func GetByIdentifier ¶
func GetByIdentifier(ctx context.Context, exec boil.ContextExecutor, value string, kind IdentifierKind) (ret Identity, err error)
GetByIdentifier using value and kind... received AnyIdentifierKind will set no filter on identifier kind
func List ¶
List ...
func Require ¶
func Require(ctx context.Context, exec boil.ContextExecutor, redConn *redis.Client, identifierValue string) (Identity, error)
Require identity, create it if not existing
func (*Identity) GetAvailableAMRs ¶
func (i *Identity) GetAvailableAMRs(ctx context.Context, exec boil.ContextExecutor) (amrs oidc.MethodRefs, err error)
GetAvailableAMRs ...
func (*Identity) GetRequiredACR ¶
GetRequiredACR ...
func (*Identity) SetAllIdentityKeys ¶
func (i *Identity) SetAllIdentityKeys(pubkeys IdentityPublicKeys) error
SetAllIdentityKeys is a shorthand for setting **all 4 identity keys** of the account. For now it will only fail if NaCl keys are missing, since AES-RSA keys are still optional to avoid breaking changes
type IdentityPublicKeys ¶
type IdentityPublicKeys struct { Pubkey null.String `json:"pubkey"` NonIdentifiedPubkey null.String `json:"non_identified_pubkey"` PubkeyAesRsa null.String `json:"pubkey_aes_rsa,omitempty"` NonIdentifiedPubkeyAesRsa null.String `json:"non_identified_pubkey_aes_rsa,omitempty"` }
type IntraprocessHelper ¶
type IntraprocessHelper struct {
// contains filtered or unexported fields
}
IntraprocessHelper offers a set of functions to interact with the identity package entities without having to pass any storage context executor - in general from external modules wishing to access some data but not owning the storage connection behind it. NOTE: no transaction logic can be then used.
func NewIntraprocessHelper ¶
func NewIntraprocessHelper(ssoDB *sql.DB, redConn *redis.Client) *IntraprocessHelper
NewIntraprocessHelper ...
func (IntraprocessHelper) Get ¶
Get ...
func (IntraprocessHelper) GetByIdentifierValue ¶
func (ih IntraprocessHelper) GetByIdentifierValue(ctx context.Context, identifierValue string) (Identity, error)
Get ...
func (IntraprocessHelper) List ¶
List ...
type Notification ¶
type Notification struct { ID int `json:"id"` Type string `json:"type"` Details null.JSON `json:"details"` CreatedAt time.Time `json:"created_at"` AcknowledgedAt null.Time `json:"acknowledged_at"` // contains filtered or unexported fields }
Notification ...
func NotificationList ¶
func NotificationList( ctx context.Context, exec boil.ContextExecutor, filters NotificationFilters, ) ([]*Notification, error)
NotificationList returns list of notifications linked to the received identity id - handles pagination.
type NotificationFilters ¶
type NotificationFilters struct { IdentityID string Type null.String Used null.Bool Offset null.Int Limit null.Int }
type ProfileView ¶
type ProfileView struct { ID string `json:"id"` DisplayName string `json:"display_name"` AvatarURL null.String `json:"avatar_url"` IdentifierValue string `json:"identifier_value"` IdentifierKind string `json:"identifier_kind"` Contactable bool `json:"contactable"` NonIdentifiedPubkey null.String `json:"non_identified_pubkey"` NonIdentifiedPubkeyAesRsa null.String `json:"non_identified_pubkey_aes_rsa"` }
ProfileView ...
func ProfileGet ¶
func ProfileGet(ctx context.Context, exec boil.ContextExecutor, identityID string) (p ProfileView, err error)
ProfileGet ...
type Service ¶
Service ...
type WebauthnIdentity ¶
type WebauthnIdentity struct { Identity WebAuthn []webauthn.Credential }
func GetEmptyWebauthnIdentity ¶
func GetEmptyWebauthnIdentity(ctx context.Context, identity Identity) (WebauthnIdentity, error)
func GetWebauthnIdentity ¶
func GetWebauthnIdentity(ctx context.Context, exec boil.ContextExecutor, identity Identity) (WebauthnIdentity, error)
func (*WebauthnIdentity) WebAuthnCredentials ¶
func (wid *WebauthnIdentity) WebAuthnCredentials() []webauthn.Credential
func (*WebauthnIdentity) WebAuthnDisplayName ¶
func (wid *WebauthnIdentity) WebAuthnDisplayName() string
func (*WebauthnIdentity) WebAuthnID ¶
func (wid *WebauthnIdentity) WebAuthnID() []byte
func (*WebauthnIdentity) WebAuthnIcon ¶
func (wid *WebauthnIdentity) WebAuthnIcon() string
func (*WebauthnIdentity) WebAuthnName ¶
func (wid *WebauthnIdentity) WebAuthnName() string