mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-30 16:08:56 +00:00
feat(relational): define session repository (#11054)
# Which Problems Are Solved As part moving sessions to the relational table, the repository to be able to manage session needs to be defined. This allows the business logic / service-layer to implement the necessary commands and the storage-layer to implement the underlying repository. # How the Problems Are Solved This PR defines the `SessionRepository` with all underlying object like the user agent, metadata, factors (including. challenges). # Additional Changes None # Additional Context - relates to #10212 --------- Co-authored-by: Copilot <[email protected]>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
"github.com/zitadel/zitadel/backend/v3/storage/database"
|
||||
)
|
||||
|
||||
type SessionUserAgent struct {
|
||||
InstanceID string `json:"instanceId,omitempty" db:"instance_id"`
|
||||
FingerprintID *string `json:"fingerprintId,omitempty" db:"fingerprint_id"`
|
||||
Description *string `json:"description,omitempty" db:"description"`
|
||||
IP net.IP `json:"ip,omitempty" db:"ip"`
|
||||
Header http.Header `json:"header,omitempty" db:"headers"`
|
||||
}
|
||||
|
||||
type sessionUserAgentColumns interface {
|
||||
// InstanceIDColumn returns the column for the instance id field.
|
||||
InstanceIDColumn() database.Column
|
||||
// FingerprintIDColumn returns the column for the fingerprint id field.
|
||||
FingerprintIDColumn() database.Column
|
||||
// IPColumn returns the column for the ip field.
|
||||
IPColumn() database.Column
|
||||
// DescriptionColumn returns the column for the description field.
|
||||
DescriptionColumn() database.Column
|
||||
// HeadersColumn returns the column for the headers field.
|
||||
HeadersColumn() database.Column
|
||||
}
|
||||
|
||||
type sessionUserAgentConditions interface {
|
||||
// PrimaryKeyCondition returns a filter on the primary key fields.
|
||||
PrimaryKeyCondition(instanceID, fingerprintID string) database.Condition
|
||||
// InstanceIDCondition returns an equal filter on the instance id field.
|
||||
InstanceIDCondition(instanceID string) database.Condition
|
||||
// FingerprintIDCondition returns an equal filter on the fingerprint id field.
|
||||
FingerprintIDCondition(fingerprintID string) database.Condition
|
||||
}
|
||||
Reference in New Issue
Block a user