Documentation
¶
Index ¶
- Variables
- type AddIdentityQuery
- type CredentialOfferColl
- type CredentialOfferDocument
- type CredentialOfferStore
- type DatastoreColl
- func (c *DatastoreColl) AddIdentity(ctx context.Context, query *AddIdentityQuery) error
- func (c *DatastoreColl) Count(ctx context.Context) (int64, error)
- func (c *DatastoreColl) Delete(ctx context.Context, doc *model.MetaData) error
- func (c *DatastoreColl) DeleteByKey(ctx context.Context, authenticSource, scope, documentID string) error
- func (c *DatastoreColl) DeleteIdentity(ctx context.Context, query *DeleteIdentityQuery) error
- func (c *DatastoreColl) Get(ctx context.Context, meta *model.MetaData) (*model.Document, error)
- func (c *DatastoreColl) GetByIdentity(ctx context.Context, scope, identityMappingID string) (map[string]*model.CompleteDocument, error)
- func (c *DatastoreColl) GetByKey(ctx context.Context, authenticSource, scope, documentID string) (*model.CompleteDocument, error)
- func (c *DatastoreColl) List(ctx context.Context, query *ListQuery) ([]*model.DocumentList, error)
- func (c *DatastoreColl) ListAuthenticSources(ctx context.Context) ([]string, error)
- func (c *DatastoreColl) Replace(ctx context.Context, doc *model.CompleteDocument) error
- func (c *DatastoreColl) Save(ctx context.Context, doc *model.CompleteDocument) error
- func (c *DatastoreColl) SaveMany(ctx context.Context, docs []*model.CompleteDocument) error
- func (c *DatastoreColl) Search(ctx context.Context, query *SearchDocumentsQuery) ([]*model.CompleteDocument, error)
- type DatastoreStore
- type DeleteIdentityQuery
- type DeleteMappingQuery
- type DynamicRegistrationColl
- type DynamicRegistrationCredentials
- type DynamicRegistrationStore
- type IdentityMappingStore
- type IdentityMappingsColl
- func (c *IdentityMappingsColl) Count(ctx context.Context) (int64, error)
- func (c *IdentityMappingsColl) CreateMapping(ctx context.Context, mapping *model.IdentityMapping) error
- func (c *IdentityMappingsColl) CreateMappings(ctx context.Context, mappings []*model.IdentityMapping) error
- func (c *IdentityMappingsColl) DeleteMapping(ctx context.Context, query *DeleteMappingQuery) error
- func (c *IdentityMappingsColl) EnsureMapping(ctx context.Context, mapping *model.IdentityMapping) error
- func (c *IdentityMappingsColl) ResolveMapping(ctx context.Context, query *ResolveMappingQuery) (string, error)
- func (c *IdentityMappingsColl) SearchMappings(ctx context.Context, query *SearchMappingsQuery) ([]*model.IdentityMapping, error)
- func (c *IdentityMappingsColl) UpdateMapping(ctx context.Context, mapping *model.IdentityMapping) error
- type ListQuery
- type ResolveMappingQuery
- type SQLCredentialOfferColl
- type SQLDatastoreColl
- func (c *SQLDatastoreColl) AddIdentity(ctx context.Context, query *AddIdentityQuery) error
- func (c *SQLDatastoreColl) Count(ctx context.Context) (int64, error)
- func (c *SQLDatastoreColl) Delete(ctx context.Context, doc *model.MetaData) error
- func (c *SQLDatastoreColl) DeleteByKey(ctx context.Context, authenticSource, scope, documentID string) error
- func (c *SQLDatastoreColl) DeleteIdentity(ctx context.Context, query *DeleteIdentityQuery) error
- func (c *SQLDatastoreColl) Get(ctx context.Context, meta *model.MetaData) (*model.Document, error)
- func (c *SQLDatastoreColl) GetByIdentity(ctx context.Context, scope, identityMappingID string) (map[string]*model.CompleteDocument, error)
- func (c *SQLDatastoreColl) GetByKey(ctx context.Context, authenticSource, scope, documentID string) (*model.CompleteDocument, error)
- func (c *SQLDatastoreColl) List(ctx context.Context, query *ListQuery) ([]*model.DocumentList, error)
- func (c *SQLDatastoreColl) ListAuthenticSources(ctx context.Context) ([]string, error)
- func (c *SQLDatastoreColl) Replace(ctx context.Context, doc *model.CompleteDocument) error
- func (c *SQLDatastoreColl) Save(ctx context.Context, doc *model.CompleteDocument) error
- func (c *SQLDatastoreColl) SaveMany(ctx context.Context, docs []*model.CompleteDocument) error
- func (c *SQLDatastoreColl) Search(ctx context.Context, query *SearchDocumentsQuery) ([]*model.CompleteDocument, error)
- type SQLDynamicRegistrationColl
- type SQLIdentityMappingsColl
- func (c *SQLIdentityMappingsColl) Count(ctx context.Context) (int64, error)
- func (c *SQLIdentityMappingsColl) CreateMapping(ctx context.Context, mapping *model.IdentityMapping) error
- func (c *SQLIdentityMappingsColl) CreateMappings(ctx context.Context, mappings []*model.IdentityMapping) error
- func (c *SQLIdentityMappingsColl) DeleteMapping(ctx context.Context, query *DeleteMappingQuery) error
- func (c *SQLIdentityMappingsColl) EnsureMapping(ctx context.Context, mapping *model.IdentityMapping) error
- func (c *SQLIdentityMappingsColl) ResolveMapping(ctx context.Context, query *ResolveMappingQuery) (string, error)
- func (c *SQLIdentityMappingsColl) SearchMappings(ctx context.Context, query *SearchMappingsQuery) ([]*model.IdentityMapping, error)
- func (c *SQLIdentityMappingsColl) UpdateMapping(ctx context.Context, mapping *model.IdentityMapping) error
- type SearchDocumentsQuery
- type SearchMappingsQuery
- type Service
Constants ¶
This section is empty.
Variables ¶
var ErrNoDocuments = errors.New("no documents in result")
ErrNoDocuments is returned when no documents are found
Functions ¶
This section is empty.
Types ¶
type AddIdentityQuery ¶ added in v0.5.7
type AddIdentityQuery struct {
AuthenticSource string `json:"authentic_source" bson:"authentic_source"`
Scope string `json:"scope" bson:"scope"`
DocumentID string `json:"document_id" bson:"document_id"`
IdentityMappingIDs []string `json:"identity_mapping_ids" bson:"identity_mapping_ids"`
}
AddIdentityQuery is the query to add document identity
type CredentialOfferColl ¶ added in v0.5.7
type CredentialOfferColl struct {
Service *Service
Coll *mongo.Collection
// contains filtered or unexported fields
}
func NewCredentialOfferColl ¶
func (*CredentialOfferColl) Delete ¶ added in v0.5.7
func (c *CredentialOfferColl) Delete(ctx context.Context, uuid string) error
Delete deletes one code_challenge
func (*CredentialOfferColl) Get ¶ added in v0.5.7
func (c *CredentialOfferColl) Get(ctx context.Context, uuid string) (*CredentialOfferDocument, error)
func (*CredentialOfferColl) Save ¶ added in v0.5.7
func (c *CredentialOfferColl) Save(ctx context.Context, doc *CredentialOfferDocument) error
type CredentialOfferDocument ¶
type CredentialOfferDocument struct {
UUID string `bson:"uuid"`
CredentialOfferParameters openid4vci.CredentialOfferParameters `bson:"credential_offer_parameters"`
}
type CredentialOfferStore ¶
type CredentialOfferStore interface {
Save(ctx context.Context, doc *CredentialOfferDocument) error
Get(ctx context.Context, uuid string) (*CredentialOfferDocument, error)
Delete(ctx context.Context, uuid string) error
}
CredentialOfferStore defines the interface for credential offer operations
type DatastoreColl ¶ added in v0.5.7
type DatastoreColl struct {
Service *Service
Coll *mongo.Collection
// contains filtered or unexported fields
}
DatastoreColl is the generic collection
func (*DatastoreColl) AddIdentity ¶ added in v0.5.7
func (c *DatastoreColl) AddIdentity(ctx context.Context, query *AddIdentityQuery) error
AddIdentity adds document identity
func (*DatastoreColl) Count ¶ added in v0.7.1
func (c *DatastoreColl) Count(ctx context.Context) (int64, error)
Count returns the (possibly approximate) number of documents in the datastore.
func (*DatastoreColl) DeleteByKey ¶ added in v0.5.7
func (c *DatastoreColl) DeleteByKey(ctx context.Context, authenticSource, scope, documentID string) error
DeleteByKey deletes a document by its natural key (authentic_source, scope, document_id)
func (*DatastoreColl) DeleteIdentity ¶ added in v0.5.7
func (c *DatastoreColl) DeleteIdentity(ctx context.Context, query *DeleteIdentityQuery) error
DeleteIdentity deletes identity in document
func (*DatastoreColl) GetByIdentity ¶ added in v0.5.7
func (c *DatastoreColl) GetByIdentity(ctx context.Context, scope, identityMappingID string) (map[string]*model.CompleteDocument, error)
GetByIdentity returns matching documents for a scope where any of the document's identity_mapping_ids match the provided identifier.
func (*DatastoreColl) GetByKey ¶ added in v0.5.7
func (c *DatastoreColl) GetByKey(ctx context.Context, authenticSource, scope, documentID string) (*model.CompleteDocument, error)
GetByKey retrieves a document by its natural key (authentic_source, scope, document_id)
func (*DatastoreColl) List ¶ added in v0.5.7
func (c *DatastoreColl) List(ctx context.Context, query *ListQuery) ([]*model.DocumentList, error)
List return matching documents if any, or error
func (*DatastoreColl) ListAuthenticSources ¶ added in v0.5.7
func (c *DatastoreColl) ListAuthenticSources(ctx context.Context) ([]string, error)
ListAuthenticSources returns all unique authentic_source values in the datastore
func (*DatastoreColl) Replace ¶ added in v0.5.7
func (c *DatastoreColl) Replace(ctx context.Context, doc *model.CompleteDocument) error
Replace replaces one document
func (*DatastoreColl) Save ¶ added in v0.5.7
func (c *DatastoreColl) Save(ctx context.Context, doc *model.CompleteDocument) error
Save saves one document to the generic collection
func (*DatastoreColl) SaveMany ¶ added in v0.5.7
func (c *DatastoreColl) SaveMany(ctx context.Context, docs []*model.CompleteDocument) error
SaveMany saves multiple documents to the generic collection using bulk insert
func (*DatastoreColl) Search ¶ added in v0.5.7
func (c *DatastoreColl) Search(ctx context.Context, query *SearchDocumentsQuery) ([]*model.CompleteDocument, error)
Search returns documents matching a text search or filters, with a limit
type DatastoreStore ¶
type DatastoreStore interface {
// Count returns the (possibly approximate) number of documents in the datastore.
Count(ctx context.Context) (int64, error)
Save(ctx context.Context, doc *model.CompleteDocument) error
SaveMany(ctx context.Context, docs []*model.CompleteDocument) error
AddIdentity(ctx context.Context, query *AddIdentityQuery) error
DeleteIdentity(ctx context.Context, query *DeleteIdentityQuery) error
Delete(ctx context.Context, doc *model.MetaData) error
Get(ctx context.Context, meta *model.MetaData) (*model.Document, error)
GetByIdentity(ctx context.Context, scope, identityMappingID string) (map[string]*model.CompleteDocument, error)
List(ctx context.Context, query *ListQuery) ([]*model.DocumentList, error)
Replace(ctx context.Context, doc *model.CompleteDocument) error
GetByKey(ctx context.Context, authenticSource, scope, documentID string) (*model.CompleteDocument, error)
DeleteByKey(ctx context.Context, authenticSource, scope, documentID string) error
Search(ctx context.Context, query *SearchDocumentsQuery) ([]*model.CompleteDocument, error)
ListAuthenticSources(ctx context.Context) ([]string, error)
}
DatastoreStore defines the interface for datastore operations
type DeleteIdentityQuery ¶ added in v0.5.7
type DeleteIdentityQuery struct {
AuthenticSource string `json:"authentic_source" bson:"authentic_source"`
Scope string `json:"scope" bson:"scope"`
DocumentID string `json:"document_id" bson:"document_id"`
AuthenticSourcePersonID string `json:"authentic_source_person_id" bson:"authentic_source_person_id"`
}
DeleteIdentityQuery is the query to delete identity in document
type DeleteMappingQuery ¶ added in v0.5.7
type DeleteMappingQuery struct {
AuthenticSource string `json:"authentic_source"`
AuthenticSourcePersonID string `json:"authentic_source_person_id"`
}
DeleteMappingQuery is the query for deleting an identity mapping
type DynamicRegistrationColl ¶ added in v0.5.7
type DynamicRegistrationColl struct {
Service *Service
Coll *mongo.Collection
// contains filtered or unexported fields
}
DynamicRegistrationColl handles persistence of dynamic client registration credentials.
func NewDynamicRegistrationColl ¶
func NewDynamicRegistrationColl(ctx context.Context, collName string, service *Service, log *logger.Log) (*DynamicRegistrationColl, error)
NewDynamicRegistrationColl creates a new collection for dynamic registration credentials.
func (*DynamicRegistrationColl) Get ¶ added in v0.5.7
func (c *DynamicRegistrationColl) Get(ctx context.Context) (*DynamicRegistrationCredentials, error)
Get returns the stored credentials, or nil if none exist.
func (*DynamicRegistrationColl) Save ¶ added in v0.5.7
func (c *DynamicRegistrationColl) Save(ctx context.Context, creds *DynamicRegistrationCredentials) error
Save stores or replaces dynamic registration credentials.
type DynamicRegistrationCredentials ¶
type DynamicRegistrationCredentials struct {
ClientID string `bson:"client_id"`
ClientSecret string `bson:"client_secret"`
RegistrationAccessToken string `bson:"registration_access_token,omitempty"`
RegistrationClientURI string `bson:"registration_client_uri,omitempty"`
ClientSecretExpiresAt int64 `bson:"client_secret_expires_at,omitempty"`
RegisteredAt time.Time `bson:"registered_at"`
}
DynamicRegistrationCredentials holds OIDC dynamic client registration credentials.
type DynamicRegistrationStore ¶ added in v0.7.1
type DynamicRegistrationStore interface {
Save(ctx context.Context, creds *DynamicRegistrationCredentials) error
Get(ctx context.Context) (*DynamicRegistrationCredentials, error)
}
DynamicRegistrationStore defines the interface for OIDC dynamic client registration operations
type IdentityMappingStore ¶ added in v0.5.7
type IdentityMappingStore interface {
// Count returns the (possibly approximate) number of identity mappings.
Count(ctx context.Context) (int64, error)
CreateMapping(ctx context.Context, mapping *model.IdentityMapping) error
CreateMappings(ctx context.Context, mappings []*model.IdentityMapping) error
EnsureMapping(ctx context.Context, mapping *model.IdentityMapping) error
ResolveMapping(ctx context.Context, query *ResolveMappingQuery) (string, error)
UpdateMapping(ctx context.Context, mapping *model.IdentityMapping) error
DeleteMapping(ctx context.Context, query *DeleteMappingQuery) error
SearchMappings(ctx context.Context, query *SearchMappingsQuery) ([]*model.IdentityMapping, error)
}
IdentityMappingStore defines the interface for identity mapping operations
type IdentityMappingsColl ¶ added in v0.5.7
type IdentityMappingsColl struct {
Service *Service
Coll *mongo.Collection
// contains filtered or unexported fields
}
IdentityMappingsColl is the collection for identity mappings
func (*IdentityMappingsColl) Count ¶ added in v0.7.1
func (c *IdentityMappingsColl) Count(ctx context.Context) (int64, error)
Count returns the (possibly approximate) number of identity mappings.
func (*IdentityMappingsColl) CreateMapping ¶ added in v0.5.7
func (c *IdentityMappingsColl) CreateMapping(ctx context.Context, mapping *model.IdentityMapping) error
CreateMapping creates a new identity mapping
func (*IdentityMappingsColl) CreateMappings ¶ added in v0.5.7
func (c *IdentityMappingsColl) CreateMappings(ctx context.Context, mappings []*model.IdentityMapping) error
CreateMappings creates multiple identity mappings using bulk insert
func (*IdentityMappingsColl) DeleteMapping ¶ added in v0.5.7
func (c *IdentityMappingsColl) DeleteMapping(ctx context.Context, query *DeleteMappingQuery) error
DeleteMapping deletes an identity mapping
func (*IdentityMappingsColl) EnsureMapping ¶ added in v0.5.7
func (c *IdentityMappingsColl) EnsureMapping(ctx context.Context, mapping *model.IdentityMapping) error
EnsureMapping creates an identity mapping only if it does not already exist. If a record with the same (authentic_source, authentic_source_person_id) already exists, it is left unchanged.
func (*IdentityMappingsColl) ResolveMapping ¶ added in v0.5.7
func (c *IdentityMappingsColl) ResolveMapping(ctx context.Context, query *ResolveMappingQuery) (string, error)
ResolveMapping resolves identity attributes to an authentic_source_person_id.
func (*IdentityMappingsColl) SearchMappings ¶ added in v0.5.7
func (c *IdentityMappingsColl) SearchMappings(ctx context.Context, query *SearchMappingsQuery) ([]*model.IdentityMapping, error)
SearchMappings returns identity mappings matching a text search or filters, with a limit
func (*IdentityMappingsColl) UpdateMapping ¶ added in v0.5.7
func (c *IdentityMappingsColl) UpdateMapping(ctx context.Context, mapping *model.IdentityMapping) error
UpdateMapping updates the attributes of an existing identity mapping
type ListQuery ¶ added in v0.5.7
type ListQuery struct {
AuthenticSource string `json:"authentic_source" bson:"authentic_source"`
IdentityMappingID string `json:"identity_mapping_id" bson:"identity_mapping_id" validate:"required"`
Scope string `json:"scope" bson:"scope"`
ValidFrom int64 `json:"valid_from" bson:"valid_from"`
ValidTo int64 `json:"valid_to" bson:"valid_to"`
}
ListQuery is the query to get document list
type ResolveMappingQuery ¶ added in v0.5.7
type ResolveMappingQuery struct {
AuthenticSource string `json:"authentic_source"`
Attributes map[string]string `json:"attributes"`
}
ResolveMappingQuery is the query for resolving attributes to an authentic_source_person_id
type SQLCredentialOfferColl ¶ added in v0.7.1
type SQLCredentialOfferColl struct {
Service *Service
// contains filtered or unexported fields
}
SQLCredentialOfferColl is a SQL-backed implementation of CredentialOfferStore.
func NewSQLCredentialOfferColl ¶ added in v0.7.1
func NewSQLCredentialOfferColl(service *Service, db *sqlx.DB, dialect sqlstore.Dialect) *SQLCredentialOfferColl
NewSQLCredentialOfferColl creates a SQL-backed CredentialOfferStore.
func (*SQLCredentialOfferColl) Delete ¶ added in v0.7.1
func (c *SQLCredentialOfferColl) Delete(ctx context.Context, uuid string) error
Delete deletes one credential offer by uuid.
func (*SQLCredentialOfferColl) Get ¶ added in v0.7.1
func (c *SQLCredentialOfferColl) Get(ctx context.Context, uuid string) (*CredentialOfferDocument, error)
Get returns the credential offer document for the given uuid.
func (*SQLCredentialOfferColl) Save ¶ added in v0.7.1
func (c *SQLCredentialOfferColl) Save(ctx context.Context, doc *CredentialOfferDocument) error
Save saves one credential offer document.
type SQLDatastoreColl ¶ added in v0.7.1
type SQLDatastoreColl struct {
Service *Service
// contains filtered or unexported fields
}
SQLDatastoreColl is a SQL-backed implementation of DatastoreStore.
func NewSQLDatastoreColl ¶ added in v0.7.1
NewSQLDatastoreColl creates a SQL-backed DatastoreStore.
func (*SQLDatastoreColl) AddIdentity ¶ added in v0.7.1
func (c *SQLDatastoreColl) AddIdentity(ctx context.Context, query *AddIdentityQuery) error
AddIdentity adds document identity.
func (*SQLDatastoreColl) Count ¶ added in v0.7.1
func (c *SQLDatastoreColl) Count(ctx context.Context) (int64, error)
Count returns the (possibly approximate) number of documents in the datastore.
func (*SQLDatastoreColl) Delete ¶ added in v0.7.1
Delete deletes a document. Mirrors Mongo's Delete: silently succeeds even if nothing matched.
func (*SQLDatastoreColl) DeleteByKey ¶ added in v0.7.1
func (c *SQLDatastoreColl) DeleteByKey(ctx context.Context, authenticSource, scope, documentID string) error
DeleteByKey deletes a document by its natural key (authentic_source, scope, document_id).
func (*SQLDatastoreColl) DeleteIdentity ¶ added in v0.7.1
func (c *SQLDatastoreColl) DeleteIdentity(ctx context.Context, query *DeleteIdentityQuery) error
DeleteIdentity deletes identity in document.
func (*SQLDatastoreColl) Get ¶ added in v0.7.1
Get returns the matching document, or an error if none exists.
func (*SQLDatastoreColl) GetByIdentity ¶ added in v0.7.1
func (c *SQLDatastoreColl) GetByIdentity(ctx context.Context, scope, identityMappingID string) (map[string]*model.CompleteDocument, error)
GetByIdentity returns matching documents for a scope where any of the document's identity mappings match the provided identifier.
func (*SQLDatastoreColl) GetByKey ¶ added in v0.7.1
func (c *SQLDatastoreColl) GetByKey(ctx context.Context, authenticSource, scope, documentID string) (*model.CompleteDocument, error)
GetByKey retrieves a document by its natural key (authentic_source, scope, document_id).
func (*SQLDatastoreColl) List ¶ added in v0.7.1
func (c *SQLDatastoreColl) List(ctx context.Context, query *ListQuery) ([]*model.DocumentList, error)
List returns matching document metadata, filtered by identity mapping and optionally authentic_source/scope.
func (*SQLDatastoreColl) ListAuthenticSources ¶ added in v0.7.1
func (c *SQLDatastoreColl) ListAuthenticSources(ctx context.Context) ([]string, error)
ListAuthenticSources returns all unique authentic_source values in the datastore.
func (*SQLDatastoreColl) Replace ¶ added in v0.7.1
func (c *SQLDatastoreColl) Replace(ctx context.Context, doc *model.CompleteDocument) error
Replace replaces one document, including its full set of identity mappings, matching by natural key. Mirrors Mongo's ReplaceOne: silently does nothing if no document matches.
func (*SQLDatastoreColl) Save ¶ added in v0.7.1
func (c *SQLDatastoreColl) Save(ctx context.Context, doc *model.CompleteDocument) error
Save saves one document to the generic collection.
func (*SQLDatastoreColl) SaveMany ¶ added in v0.7.1
func (c *SQLDatastoreColl) SaveMany(ctx context.Context, docs []*model.CompleteDocument) error
SaveMany saves multiple documents to the generic collection.
func (*SQLDatastoreColl) Search ¶ added in v0.7.1
func (c *SQLDatastoreColl) Search(ctx context.Context, query *SearchDocumentsQuery) ([]*model.CompleteDocument, error)
Search returns documents matching a text search or filters, with a limit. The document_data.* text search is a known perf tradeoff vs Mongo's regex-across-BSON: neither Postgres nor MariaDB can cheaply full-text index arbitrary, unschema'd JSON keys without knowing them in advance.
type SQLDynamicRegistrationColl ¶ added in v0.7.1
type SQLDynamicRegistrationColl struct {
Service *Service
// contains filtered or unexported fields
}
SQLDynamicRegistrationColl is a SQL-backed implementation of DynamicRegistrationStore.
func NewSQLDynamicRegistrationColl ¶ added in v0.7.1
func NewSQLDynamicRegistrationColl(service *Service, db *sqlx.DB, dialect sqlstore.Dialect) *SQLDynamicRegistrationColl
NewSQLDynamicRegistrationColl creates a SQL-backed DynamicRegistrationStore.
func (*SQLDynamicRegistrationColl) Get ¶ added in v0.7.1
func (c *SQLDynamicRegistrationColl) Get(ctx context.Context) (*DynamicRegistrationCredentials, error)
Get returns the stored credentials, or nil if none exist or the client secret has expired.
func (*SQLDynamicRegistrationColl) Save ¶ added in v0.7.1
func (c *SQLDynamicRegistrationColl) Save(ctx context.Context, creds *DynamicRegistrationCredentials) error
Save stores or replaces dynamic registration credentials, upserting by client_id.
type SQLIdentityMappingsColl ¶ added in v0.7.1
type SQLIdentityMappingsColl struct {
Service *Service
// contains filtered or unexported fields
}
SQLIdentityMappingsColl is a SQL-backed implementation of IdentityMappingStore.
func NewSQLIdentityMappingsColl ¶ added in v0.7.1
func NewSQLIdentityMappingsColl(service *Service, db *sqlx.DB, dialect sqlstore.Dialect) *SQLIdentityMappingsColl
NewSQLIdentityMappingsColl creates a SQL-backed IdentityMappingStore.
func (*SQLIdentityMappingsColl) Count ¶ added in v0.7.1
func (c *SQLIdentityMappingsColl) Count(ctx context.Context) (int64, error)
Count returns the (possibly approximate) number of identity mappings.
func (*SQLIdentityMappingsColl) CreateMapping ¶ added in v0.7.1
func (c *SQLIdentityMappingsColl) CreateMapping(ctx context.Context, mapping *model.IdentityMapping) error
CreateMapping creates a new identity mapping.
func (*SQLIdentityMappingsColl) CreateMappings ¶ added in v0.7.1
func (c *SQLIdentityMappingsColl) CreateMappings(ctx context.Context, mappings []*model.IdentityMapping) error
CreateMappings creates multiple identity mappings in a single statement.
func (*SQLIdentityMappingsColl) DeleteMapping ¶ added in v0.7.1
func (c *SQLIdentityMappingsColl) DeleteMapping(ctx context.Context, query *DeleteMappingQuery) error
DeleteMapping deletes an identity mapping.
func (*SQLIdentityMappingsColl) EnsureMapping ¶ added in v0.7.1
func (c *SQLIdentityMappingsColl) EnsureMapping(ctx context.Context, mapping *model.IdentityMapping) error
EnsureMapping creates an identity mapping only if it does not already exist. If a record with the same (authentic_source, authentic_source_person_id) already exists, it is left unchanged.
func (*SQLIdentityMappingsColl) ResolveMapping ¶ added in v0.7.1
func (c *SQLIdentityMappingsColl) ResolveMapping(ctx context.Context, query *ResolveMappingQuery) (string, error)
ResolveMapping resolves identity attributes to an authentic_source_person_id.
func (*SQLIdentityMappingsColl) SearchMappings ¶ added in v0.7.1
func (c *SQLIdentityMappingsColl) SearchMappings(ctx context.Context, query *SearchMappingsQuery) ([]*model.IdentityMapping, error)
SearchMappings returns identity mappings matching a text search or filters, with a limit.
func (*SQLIdentityMappingsColl) UpdateMapping ¶ added in v0.7.1
func (c *SQLIdentityMappingsColl) UpdateMapping(ctx context.Context, mapping *model.IdentityMapping) error
UpdateMapping updates the attributes of an existing identity mapping.
type SearchDocumentsQuery ¶
type SearchDocumentsQuery struct {
Search string `json:"search"`
AuthenticSource string `json:"authentic_source"`
Scope string `json:"scope"`
Limit int64 `json:"limit"`
AllowedAuthenticSources []string `json:"-"`
AllowedScopes []string `json:"-"`
}
SearchDocumentsQuery is the query for searching documents
type SearchMappingsQuery ¶ added in v0.5.7
type SearchMappingsQuery struct {
Search string `json:"search"`
AuthenticSource string `json:"authentic_source"`
Limit int64 `json:"limit"`
AllowedAuthenticSources []string `json:"-"`
}
SearchMappingsQuery is the query for searching identity mappings
type Service ¶
type Service struct {
MongoClient *mongo.Client
SQLDB *sqlx.DB
DatastoreColl DatastoreStore
IdentityMappingsColl IdentityMappingStore
CredentialOfferColl CredentialOfferStore
DynamicRegistrationColl DynamicRegistrationStore
// contains filtered or unexported fields
}
Service is the database service
func New ¶
func New(ctx context.Context, cfg *model.Cfg, tracer *trace.Tracer, log *logger.Log) (*Service, error)
New creates a new database service. The storage backend is selected by cfg.Common.SQL.Backend: "postgres" or "mariadb" connect to the corresponding relational database (via pkg/sqlstore, running schema migrations at startup); anything else (including unset, the default) keeps the existing MongoDB-backed behavior unchanged.
func (*Service) Status ¶
func (s *Service) Status(ctx context.Context) *apiv1_status.StatusProbe
Status returns the status of the database