45 lines
1019 B
TypeScript
45 lines
1019 B
TypeScript
import type { Field } from 'payload'
|
|
|
|
/**
|
|
* Cloudflare R2 storage credentials.
|
|
* Reserved for future use — media offloading to R2.
|
|
*
|
|
* Protected at the global level (SiteIntegrations requires an authenticated
|
|
* user), so the access keys stay editable in the admin panel while remaining
|
|
* inaccessible to anonymous API requests.
|
|
*/
|
|
export const storageFields: Field[] = [
|
|
{
|
|
name: 'r2Bucket',
|
|
type: 'text',
|
|
admin: {
|
|
description: 'R2 bucket name.',
|
|
},
|
|
},
|
|
{
|
|
name: 'r2Endpoint',
|
|
type: 'text',
|
|
admin: {
|
|
description: 'R2 S3-compatible endpoint URL.',
|
|
},
|
|
},
|
|
{
|
|
name: 'r2AccessKeyId',
|
|
type: 'text',
|
|
admin: {
|
|
description: 'R2 access key ID.',
|
|
},
|
|
},
|
|
{
|
|
name: 'r2SecretAccessKey',
|
|
type: 'text',
|
|
admin: {
|
|
description: 'R2 secret access key.',
|
|
// Masked in the UI (••••) — stored plaintext, readable for R2 auth.
|
|
components: {
|
|
Field: '@intecion/ipal-kit/client#MaskedField',
|
|
},
|
|
},
|
|
},
|
|
]
|