Documentation
¶
Overview ¶
Package rauthadapter implements the AuthAdapterService ConnectRPC handler, bridging BetterAuth JSON adapter calls to the authadapter package.
BetterAuth schema ¶
The following models and fields are defined by the BetterAuth schema and must be honoured by every RPC method. Fields marked required must be present in Create payloads; optional fields are omitted or null. Date fields are transmitted as Unix timestamps (int64 / float64).
## user (order 1)
Field Type Required Unique Sortable Notes ───────────────────────────────────────────────────────── id string auto ULID generated by adapter name string yes Y email string yes Y Y emailVerified boolean yes default false; input: false image string no createdAt date yes updatedAt date yes
Supported where fields for Find: id, email Supported where fields for Update: id Supported where fields for Delete: id
## session (order 2)
Field Type Required Unique Notes ──────────────────────────────────────────────────────────────── id string auto expiresAt date yes token string yes Y createdAt date yes updatedAt date yes ipAddress string no userAgent string no userId string yes FK → user.id, onDelete cascade, indexed
Supported where fields for Find: id, token Supported where fields for FindMany: userId (eq) Supported where fields for Update: id Supported where fields for Delete: id, token Supported where fields for DeleteMany: userId (eq) | expiresAt (lt)
## account (order 3)
Field Type Required Notes ────────────────────────────────────────────────────────────────────── id string auto accountId string yes providerId string yes userId string yes FK → user.id, onDelete cascade, indexed accessToken string no returned: false refreshToken string no returned: false idToken string no returned: false accessTokenExpiresAt date no returned: false refreshTokenExpiresAt date no returned: false scope string no password string no returned: false (credential provider) createdAt date yes updatedAt date yes
Supported where fields for Find: id | (providerId + accountId) (both eq) Supported where fields for FindMany: userId (eq) Supported where fields for Update: id Supported where fields for Delete: id Supported where fields for DeleteMany: userId (eq)
## verification (order 4)
Field Type Required Notes ──────────────────────────────────────── id string auto identifier string yes indexed value string yes expiresAt date yes createdAt date yes updatedAt date yes
Supported where fields for Find: id, identifier Supported where fields for Delete: id Supported where fields for DeleteMany: expiresAt (lt)
## jwks
Field Type Required ─────────────────────────── publicKey string yes privateKey string yes createdAt date yes expiresAt date no
Supported operations: Create, FindMany, Delete (by id).
Index ¶
- func CreateService(h AuthAdapterRPC, opts []connect.HandlerOption) (*api.Service, error)
- type AuthAdapterRPC
- func (h AuthAdapterRPC) Count(ctx context.Context, req *connect.Request[auth_adapterv1.CountRequest]) (*connect.Response[auth_adapterv1.CountResponse], error)
- func (h AuthAdapterRPC) Create(ctx context.Context, req *connect.Request[auth_adapterv1.CreateRequest]) (*connect.Response[auth_adapterv1.CreateResponse], error)
- func (h AuthAdapterRPC) Delete(ctx context.Context, req *connect.Request[auth_adapterv1.DeleteRequest]) (*connect.Response[emptypb.Empty], error)
- func (h AuthAdapterRPC) DeleteMany(ctx context.Context, req *connect.Request[auth_adapterv1.DeleteManyRequest]) (*connect.Response[auth_adapterv1.DeleteManyResponse], error)
- func (h AuthAdapterRPC) Find(ctx context.Context, req *connect.Request[auth_adapterv1.FindRequest]) (*connect.Response[auth_adapterv1.FindResponse], error)
- func (h AuthAdapterRPC) FindMany(ctx context.Context, req *connect.Request[auth_adapterv1.FindManyRequest]) (*connect.Response[auth_adapterv1.FindManyResponse], error)
- func (h AuthAdapterRPC) Update(ctx context.Context, req *connect.Request[auth_adapterv1.UpdateRequest]) (*connect.Response[auth_adapterv1.UpdateResponse], error)
- func (h AuthAdapterRPC) UpdateMany(ctx context.Context, req *connect.Request[auth_adapterv1.UpdateManyRequest]) (*connect.Response[auth_adapterv1.UpdateManyResponse], error)
- type AuthAdapterRPCDeps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateService ¶
func CreateService(h AuthAdapterRPC, opts []connect.HandlerOption) (*api.Service, error)
CreateService registers the handler and returns an api.Service.
Types ¶
type AuthAdapterRPC ¶
type AuthAdapterRPC struct {
auth_adapterv1connect.UnimplementedAuthAdapterServiceHandler
// contains filtered or unexported fields
}
AuthAdapterRPC implements AuthAdapterServiceHandler.
func (AuthAdapterRPC) Count ¶
func (h AuthAdapterRPC) Count(ctx context.Context, req *connect.Request[auth_adapterv1.CountRequest]) (*connect.Response[auth_adapterv1.CountResponse], error)
func (AuthAdapterRPC) Create ¶
func (h AuthAdapterRPC) Create(ctx context.Context, req *connect.Request[auth_adapterv1.CreateRequest]) (*connect.Response[auth_adapterv1.CreateResponse], error)
func (AuthAdapterRPC) Delete ¶
func (h AuthAdapterRPC) Delete(ctx context.Context, req *connect.Request[auth_adapterv1.DeleteRequest]) (*connect.Response[emptypb.Empty], error)
func (AuthAdapterRPC) DeleteMany ¶
func (h AuthAdapterRPC) DeleteMany(ctx context.Context, req *connect.Request[auth_adapterv1.DeleteManyRequest]) (*connect.Response[auth_adapterv1.DeleteManyResponse], error)
func (AuthAdapterRPC) Find ¶
func (h AuthAdapterRPC) Find(ctx context.Context, req *connect.Request[auth_adapterv1.FindRequest]) (*connect.Response[auth_adapterv1.FindResponse], error)
func (AuthAdapterRPC) FindMany ¶
func (h AuthAdapterRPC) FindMany(ctx context.Context, req *connect.Request[auth_adapterv1.FindManyRequest]) (*connect.Response[auth_adapterv1.FindManyResponse], error)
func (AuthAdapterRPC) Update ¶
func (h AuthAdapterRPC) Update(ctx context.Context, req *connect.Request[auth_adapterv1.UpdateRequest]) (*connect.Response[auth_adapterv1.UpdateResponse], error)
func (AuthAdapterRPC) UpdateMany ¶
func (h AuthAdapterRPC) UpdateMany(ctx context.Context, req *connect.Request[auth_adapterv1.UpdateManyRequest]) (*connect.Response[auth_adapterv1.UpdateManyResponse], error)
type AuthAdapterRPCDeps ¶
type AuthAdapterRPCDeps struct {
Adapter *authadapter.Adapter
}
AuthAdapterRPCDeps holds dependencies for the handler.