2026-03-16 17:06:53 +01:00
|
|
|
package schema
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"entgo.io/ent"
|
|
|
|
|
"entgo.io/ent/schema/field"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// AuthSession holds the schema definition for the AuthSession entity.
|
|
|
|
|
type AuthSession struct {
|
|
|
|
|
ent.Schema
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Fields of the AuthSession.
|
|
|
|
|
func (AuthSession) Fields() []ent.Field {
|
|
|
|
|
return []ent.Field{
|
|
|
|
|
field.Text("id").
|
|
|
|
|
SchemaType(textSchema).
|
|
|
|
|
NotEmpty().
|
|
|
|
|
Unique(),
|
2026-03-18 11:58:18 +01:00
|
|
|
field.Text("user_id").
|
|
|
|
|
SchemaType(textSchema).
|
|
|
|
|
NotEmpty(),
|
|
|
|
|
field.Text("connector_id").
|
|
|
|
|
SchemaType(textSchema).
|
|
|
|
|
NotEmpty(),
|
|
|
|
|
field.Text("nonce").
|
|
|
|
|
SchemaType(textSchema).
|
|
|
|
|
NotEmpty(),
|
2026-03-16 17:06:53 +01:00
|
|
|
field.Bytes("client_states"),
|
|
|
|
|
field.Time("created_at").
|
|
|
|
|
SchemaType(timeSchema),
|
|
|
|
|
field.Time("last_activity").
|
|
|
|
|
SchemaType(timeSchema),
|
|
|
|
|
field.Text("ip_address").
|
|
|
|
|
SchemaType(textSchema).
|
|
|
|
|
Default(""),
|
|
|
|
|
field.Text("user_agent").
|
|
|
|
|
SchemaType(textSchema).
|
|
|
|
|
Default(""),
|
2026-03-20 20:06:43 +01:00
|
|
|
field.Time("absolute_expiry").
|
|
|
|
|
SchemaType(timeSchema),
|
|
|
|
|
field.Time("idle_expiry").
|
|
|
|
|
SchemaType(timeSchema),
|
2026-04-13 19:25:51 +02:00
|
|
|
field.Bytes("connector_data").
|
|
|
|
|
Nillable().
|
|
|
|
|
Optional(),
|
2026-03-16 17:06:53 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Edges of the AuthSession.
|
|
|
|
|
func (AuthSession) Edges() []ent.Edge {
|
|
|
|
|
return []ent.Edge{}
|
|
|
|
|
}
|