rauthadapter

package
v0.0.0-...-36d6306 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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

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 New

New creates an AuthAdapterRPC handler.

type AuthAdapterRPCDeps

type AuthAdapterRPCDeps struct {
	Adapter *authadapter.Adapter
}

AuthAdapterRPCDeps holds dependencies for the handler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL