Add upload token config validation

This commit is contained in:
2026-06-08 04:27:49 +00:00
parent 4fa7d1ebb5
commit 033b2e5015
11 changed files with 278 additions and 40 deletions

View File

@@ -1,9 +1,10 @@
package config
type Config struct {
Server Server `yaml:"server"`
Secrets Secrets `yaml:"secrets"`
Pipelines []Pipeline `yaml:"pipelines"`
Server Server `yaml:"server"`
Secrets Secrets `yaml:"secrets"`
UploadTokens []UploadToken `yaml:"upload_tokens"`
Pipelines []Pipeline `yaml:"pipelines"`
}
type Server struct {
@@ -23,6 +24,12 @@ type Secrets struct {
Directory string `yaml:"directory"`
}
type UploadToken struct {
ID string `yaml:"id"`
TokenEnv string `yaml:"token_env"`
AllowPipelines []string `yaml:"allow_pipelines"`
}
type Pipeline struct {
ID string `yaml:"id"`
Source Backend `yaml:"source"`
@@ -68,7 +75,6 @@ type Backend struct {
}
type HTTPUpload struct {
TokenEnv string `yaml:"token_env"`
StagingPath string `yaml:"staging_path"`
MaxUploadSize *ByteSize `yaml:"max_upload_size"`
}