Skip to content

Commit

Permalink
feat(config): update to account for credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeMac committed Jan 30, 2025
1 parent 8b9280b commit 809b878
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 96 deletions.
46 changes: 26 additions & 20 deletions config/flipt.schema.cue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import "list"
diagnostics?: #diagnostics
environments?: #environments
storage?: #storage
credentials?: #credentials
log?: #log
meta?: #meta
server?: #server
Expand Down Expand Up @@ -195,26 +196,7 @@ import "list"
ca_cert_path?: string
ca_cert_bytes?: string
insecure_skip_tls?: bool | *false
authentication?: ({
basic: {
username: string
password: string
}
} | {
token: access_token: string
} | {
ssh: {
user?: string | *"git"
password: string
private_key_path: string
}
} | {
ssh: {
user?: string | *"git"
password: string
private_key_bytes: string
}
})
credentials?: string
publishers?: {
object?: {
type: "s3" | "azblob" | "googlecloud" | *""
Expand All @@ -239,6 +221,30 @@ import "list"
}
}

#credentials: [string]: {
type: "basic"
basic: {
username: string
password: string
}
} | {
type: "ssh"
ssh: {
user?: string
password: string
private_key_bytes: string
insecure_ignore_host_key?: bool
} | {
user?: string
password: string
private_key_path: string
insecure_ignore_host_key?: bool
}
} | {
type: "access_token"
access_token: string
}

_#lower: ["debug", "error", "fatal", "info", "panic", "warn"]
_#all: list.Concat([_#lower, [for x in _#lower {strings.ToUpper(x)}]])
#log: {
Expand Down
160 changes: 84 additions & 76 deletions config/flipt.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -618,82 +618,8 @@
"type": "boolean",
"default": false
},
"authentication": {
"oneOf": [
{
"type": "object",
"properties": {
"basic": {
"type": "object",
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": ["username", "password"]
}
}
},
{
"type": "object",
"properties": {
"token": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
}
},
"required": ["access_token"]
}
}
},
{
"type": "object",
"properties": {
"ssh": {
"type": "object",
"properties": {
"user": {
"type": "string",
"default": "git"
},
"password": {
"type": "string"
},
"private_key_path": {
"type": "string"
}
},
"required": ["password", "private_key_path"]
}
}
},
{
"type": "object",
"properties": {
"ssh": {
"type": "object",
"properties": {
"user": {
"type": "string",
"default": "git"
},
"password": {
"type": "string"
},
"private_key_bytes": {
"type": "string"
}
},
"required": ["password", "private_key_bytes"]
}
}
}
]
"credentials": {
"type": "string"
},
"publishers": {
"type": "object",
Expand Down Expand Up @@ -768,6 +694,88 @@
}
}
},
"credentials": {
"type": "object",
"patternProperties": {
"^.*$": {
"oneOf": [
{
"type": "object",
"properties": {
"basic": {
"type": "object",
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": ["username", "password"]
}
}
},
{
"type": "object",
"properties": {
"token": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
}
},
"required": ["access_token"]
}
}
},
{
"type": "object",
"properties": {
"ssh": {
"type": "object",
"properties": {
"user": {
"type": "string",
"default": "git"
},
"password": {
"type": "string"
},
"private_key_path": {
"type": "string"
}
},
"required": ["password", "private_key_path"]
}
}
},
{
"type": "object",
"properties": {
"ssh": {
"type": "object",
"properties": {
"user": {
"type": "string",
"default": "git"
},
"password": {
"type": "string"
},
"private_key_bytes": {
"type": "string"
}
},
"required": ["password", "private_key_bytes"]
}
}
}
]
}
}
},
"log": {
"type": "object",
"title": "Log",
Expand Down

0 comments on commit 809b878

Please sign in to comment.