fmt.Fprintf(stderr,"felis api: [registry] context_max_bytes %q is not a positive size such as 95Mi; keeping the default\n",cfg.Registry.ContextMaxBytes)
fmt.Fprintf(stderr,"felis api: [registry] context_max_bytes %q is not a positive size such as 512Mi; keeping the default\n",cfg.Registry.ContextMaxBytes)
{name:"direct install keeps the package default",want:0},
{name:"access audience means the Cloudflare edge",auth:config.AuthConfig{AccessJWTAud:"aud-1"},want:99614720},
{name:"CF-Connecting-IP header means the Cloudflare edge",auth:config.AuthConfig{ClientIPHeader:"cf-connecting-ip"},want:99614720},
{name:"an operator proxy keeps the package default",auth:config.AuthConfig{ClientIPHeader:"X-Forwarded-For"},want:0},
{name:"explicit value wins over the edge default",reg:config.RegistryConfig{ContextMaxBytes:"50Mi"},auth:config.AuthConfig{AccessJWTAud:"aud-1"},want:52428800},
// The panel uploads in parts under the edge's 100 MB body limit, so the
// Cloudflare edge keeps the full default.
{name:"the Cloudflare edge keeps the package default",auth:config.AuthConfig{AccessJWTAud:"aud-1"},want:0},
{name:"CF-Connecting-IP keeps the package default",auth:config.AuthConfig{ClientIPHeader:"cf-connecting-ip"},want:0},
{name:"explicit value behind the edge",reg:config.RegistryConfig{ContextMaxBytes:"50Mi"},auth:config.AuthConfig{AccessJWTAud:"aud-1"},want:52428800},
{name:"explicit value on a direct install",reg:config.RegistryConfig{ContextMaxBytes:"2Gi"},want:2147483648},
{name:"garbage is refused",reg:config.RegistryConfig{ContextMaxBytes:"lots"},wantErr:true},
{name:"zero is refused",reg:config.RegistryConfig{ContextMaxBytes:"0"},wantErr:true},