test: add Bruno API test collections for device authentication
- Device token regeneration tests (success, forbidden, not found, unauthorized) - OPDS authentication tests (Bearer token, query token) - Kobo sync tests with token authentication - Test various authentication methods and error cases
This commit is contained in:
@@ -6573,6 +6573,42 @@ func (q *Queries) UpdateDevice(ctx context.Context, arg UpdateDeviceParams) (Dev
|
||||
return i, err
|
||||
}
|
||||
|
||||
const UpdateDeviceAuthToken = `-- name: UpdateDeviceAuthToken :one
|
||||
UPDATE devices
|
||||
SET
|
||||
auth_token = $2,
|
||||
updated_at = NOW()
|
||||
WHERE id = $1
|
||||
RETURNING id, user_id, device_name, device_type, device_identifier, auth_token, last_sync, last_seen, sync_enabled, auto_sync, sync_frequency_minutes, device_metadata, created_at, updated_at
|
||||
`
|
||||
|
||||
type UpdateDeviceAuthTokenParams struct {
|
||||
ID pgtype.UUID `db:"id" json:"id"`
|
||||
AuthToken string `db:"auth_token" json:"auth_token"`
|
||||
}
|
||||
|
||||
func (q *Queries) UpdateDeviceAuthToken(ctx context.Context, arg UpdateDeviceAuthTokenParams) (Devices, error) {
|
||||
row := q.db.QueryRow(ctx, UpdateDeviceAuthToken, arg.ID, arg.AuthToken)
|
||||
var i Devices
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.UserID,
|
||||
&i.DeviceName,
|
||||
&i.DeviceType,
|
||||
&i.DeviceIdentifier,
|
||||
&i.AuthToken,
|
||||
&i.LastSync,
|
||||
&i.LastSeen,
|
||||
&i.SyncEnabled,
|
||||
&i.AutoSync,
|
||||
&i.SyncFrequencyMinutes,
|
||||
&i.DeviceMetadata,
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const UpdateDeviceCatalogAvailability = `-- name: UpdateDeviceCatalogAvailability :exec
|
||||
UPDATE device_catalogs
|
||||
SET available = $2
|
||||
|
||||
Reference in New Issue
Block a user