Documentation
¶
Index ¶
- Constants
- type AuthCacheConfig
- type AuthConfig
- type BasicAuthConfig
- type BucketConfig
- type BucketProjectConfig
- type BucketResourceConfig
- type BucketScopeConfig
- type Config
- type CredentialEncryptionConfig
- type DatabaseConfig
- type LFSConfig
- type MockAuthConfig
- type PluginPaths
- type PostgresConfig
- type RoutesConfig
- type S3Config
- type SigningConfig
- type SqliteConfig
Constants ¶
View Source
const ( S3Prefix = common.S3Prefix GCSPrefix = common.GCSPrefix AzurePrefix = common.AzurePrefix DRSPrefix = common.DRSPrefix DefaultS3Region = "us-east-1" DefaultSigningExpirySeconds = 900 // 15 minutes // --- Route Constants --- RouteHealthz = "/healthz" // LFS RouteLFSBatch = "/info/lfs/objects/batch" RouteLFSMetadata = "/info/lfs/objects/metadata" RouteLFSObject = "/info/lfs/objects/{oid}" RouteLFSVerify = "/info/lfs/verify" // Metrics RouteMetricsFiles = "/index/v1/metrics/files" RouteMetricsFileDetail = "/index/v1/metrics/files/{object_id}" RouteMetricsSummary = "/index/v1/metrics/summary" // Docs RouteSwaggerUI = "/index/swagger" RouteSwaggerUIAlt = "/index/swagger/" RouteOpenAPISpec = "/index/openapi.yaml" RouteLFSSpec = "/index/openapi-lfs.yaml" RouteBucketSpec = "/index/openapi-bucket.yaml" RouteInternalSpec = "/index/openapi-internal.yaml" // Internal DRS Data RouteInternalDownload = "/data/download/{file_id}" RouteInternalDownloadPart = "/data/download/{file_id}/part" RouteInternalUpload = "/data/upload" RouteInternalUploadURL = "/data/upload/{file_id}" RouteInternalUploadBulk = "/data/upload/bulk" RouteInternalMultipartInit = "/data/multipart/init" RouteInternalMultipartUpload = "/data/multipart/upload" RouteInternalMultipartComplete = "/data/multipart/complete" RouteInternalBuckets = "/data/buckets" RouteInternalBucketDetail = "/data/buckets/{bucket}" RouteInternalBucketScopes = "/data/buckets/{bucket}/scopes" // Internal DRS Index RouteInternalIndex = "/index" RouteInternalIndexDetail = "/index/{id}" RouteInternalBulkHashes = "/index/bulk/hashes" RouteInternalBulkDeleteHashes = "/index/bulk/delete" RouteInternalBulkSHA256 = "/index/bulk/sha256/validity" RouteInternalBulkCreate = "/index/bulk" RouteInternalBulkDocs = "/index/bulk/documents" // Core API RouteCoreSHA256 = "/index/v1/sha256/validity" )
View Source
const ( AuthModeLocal = "local" AuthModeGen3 = "gen3" )
View Source
const ( DefaultLFSMaxBatchObjects = 1000 DefaultLFSMaxBatchBodyBytes int64 = 10 * 1024 * 1024 // 10 MiB DefaultLFSRequestLimitPerMinute = 1200 // 20 req/sec average per client DefaultLFSBandwidthLimitBytesPerMinute int64 = 0 // disabled by default )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthCacheConfig ¶ added in v0.2.4
type AuthCacheConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
TTLSeconds int `json:"ttl_seconds" yaml:"ttl_seconds"`
NegativeTTL int `json:"negative_ttl_seconds" yaml:"negative_ttl_seconds"`
MaxEntries int `json:"max_entries" yaml:"max_entries"`
CleanupEvery int `json:"cleanup_seconds" yaml:"cleanup_seconds"`
}
type AuthConfig ¶
type AuthConfig struct {
Mode string `json:"mode" yaml:"mode"`
Basic BasicAuthConfig `json:"basic" yaml:"basic"`
LocalAuthzCSV string `json:"local_authz_csv" yaml:"local_authz_csv"`
AllowUnauthenticated bool `json:"allow_unauthenticated" yaml:"allow_unauthenticated"`
Mock MockAuthConfig `json:"mock" yaml:"mock"`
Cache AuthCacheConfig `json:"cache" yaml:"cache"`
PluginPaths PluginPaths `json:"plugin_paths" yaml:"plugin_paths"`
FenceURL string `json:"fence_url" yaml:"fence_url"`
}
type BasicAuthConfig ¶
type BasicAuthConfig struct {
Username string `json:"username" yaml:"username"`
Password string `json:"password" yaml:"password"`
}
func (BasicAuthConfig) MarshalJSON ¶ added in v0.2.4
func (b BasicAuthConfig) MarshalJSON() ([]byte, error)
SECURITY FIX MED-1: Redact password when marshaling to JSON
type BucketConfig ¶ added in v0.2.8
type BucketConfig struct {
Bucket string `json:"bucket" yaml:"bucket"`
Provider string `json:"provider,omitempty" yaml:"provider,omitempty"`
Region string `json:"region" yaml:"region"`
AccessKey string `json:"access_key" yaml:"access_key"`
SecretKey string `json:"secret_key" yaml:"secret_key"`
Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
Resources []BucketResourceConfig `json:"resources,omitempty" yaml:"resources,omitempty"`
}
func (BucketConfig) MarshalJSON ¶ added in v0.2.8
func (b BucketConfig) MarshalJSON() ([]byte, error)
SECURITY FIX MED-1: Redact secret key when marshaling to JSON
type BucketProjectConfig ¶ added in v0.2.8
type BucketProjectConfig struct {
ProjectID string `json:"project_id,omitempty" yaml:"project_id,omitempty"`
Project string `json:"project,omitempty" yaml:"project,omitempty"`
ProjectPath string `json:"project_path,omitempty" yaml:"project_path,omitempty"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
PathPrefix string `json:"path_prefix,omitempty" yaml:"path_prefix,omitempty"`
}
type BucketResourceConfig ¶ added in v0.2.8
type BucketResourceConfig struct {
Organization string `json:"organization" yaml:"organization"`
OrgPath string `json:"org_path,omitempty" yaml:"org_path,omitempty"`
Projects []BucketProjectConfig `json:"projects,omitempty" yaml:"projects,omitempty"`
}
type BucketScopeConfig ¶ added in v0.2.8
type BucketScopeConfig struct {
Organization string `json:"organization" yaml:"organization"`
ProjectID string `json:"project_id" yaml:"project_id"`
Bucket string `json:"bucket,omitempty" yaml:"bucket,omitempty"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
PathPrefix string `json:"path_prefix,omitempty" yaml:"path_prefix,omitempty"`
OrganizationSubPath string `json:"organization_sub_path,omitempty" yaml:"organization_sub_path,omitempty"`
ProjectSubPath string `json:"project_sub_path,omitempty" yaml:"project_sub_path,omitempty"`
}
type Config ¶
type Config struct {
Port int `json:"port" yaml:"port"`
Database DatabaseConfig `json:"database" yaml:"database"`
Buckets []BucketConfig `json:"buckets,omitempty" yaml:"buckets,omitempty"`
S3Credentials []BucketConfig `json:"s3_credentials,omitempty" yaml:"s3_credentials,omitempty"`
BucketScopes []BucketScopeConfig `json:"bucket_scopes" yaml:"bucket_scopes"`
CredentialEncryption CredentialEncryptionConfig `json:"credential_encryption" yaml:"credential_encryption"`
Auth AuthConfig `json:"auth" yaml:"auth"`
LFS LFSConfig `json:"lfs" yaml:"lfs"`
Signing SigningConfig `json:"signing" yaml:"signing"`
Routes RoutesConfig `json:"routes" yaml:"routes"`
}
func LoadConfig ¶
type CredentialEncryptionConfig ¶ added in v0.2.5
type CredentialEncryptionConfig struct {
LocalKeyFile string `json:"local_key_file" yaml:"local_key_file"`
MasterKey string `json:"master_key" yaml:"master_key"`
}
func (CredentialEncryptionConfig) MarshalJSON ¶ added in v0.2.7
func (c CredentialEncryptionConfig) MarshalJSON() ([]byte, error)
type DatabaseConfig ¶
type DatabaseConfig struct {
Sqlite *SqliteConfig `json:"sqlite,omitempty" yaml:"sqlite,omitempty"`
Postgres *PostgresConfig `json:"postgres,omitempty" yaml:"postgres,omitempty"`
}
type LFSConfig ¶
type LFSConfig struct {
MaxBatchObjects int `json:"max_batch_objects" yaml:"max_batch_objects"`
MaxBatchBodyBytes int64 `json:"max_batch_body_bytes" yaml:"max_batch_body_bytes"`
RequestLimitPerMinute int `json:"request_limit_per_minute" yaml:"request_limit_per_minute"`
BandwidthLimitBytesPerMinute int64 `json:"bandwidth_limit_bytes_per_minute" yaml:"bandwidth_limit_bytes_per_minute"`
}
type MockAuthConfig ¶ added in v0.2.4
type PluginPaths ¶ added in v0.2.4
type PostgresConfig ¶
type PostgresConfig struct {
Host string `json:"host" yaml:"host"`
Port int `json:"port" yaml:"port"`
User string `json:"user" yaml:"user"`
Password string `json:"password" yaml:"password"`
Database string `json:"database" yaml:"database"`
SSLMode string `json:"sslmode" yaml:"sslmode"`
}
func (PostgresConfig) MarshalJSON ¶ added in v0.2.4
func (p PostgresConfig) MarshalJSON() ([]byte, error)
SECURITY FIX MED-1: Redact password when marshaling to JSON
type RoutesConfig ¶
type S3Config ¶
type S3Config = BucketConfig
type SigningConfig ¶
type SigningConfig struct {
DefaultExpirySeconds int `json:"default_expiry_seconds" yaml:"default_expiry_seconds"`
}
type SqliteConfig ¶
type SqliteConfig struct {
File string `json:"file" yaml:"file"`
}
Click to show internal directories.
Click to hide internal directories.