Adds LDAP auth support

This commit is contained in:
Jamie Curnow
2024-11-02 21:36:07 +10:00
parent 8434a2d1fa
commit a277a5d167
54 changed files with 765 additions and 306 deletions

View File

@ -64,6 +64,9 @@ const anyType = `
},
{
"type": "integer"
},
{
"type": "string"
}
]
}

View File

@ -16,7 +16,6 @@ func CreateUser() string {
],
"properties": {
"name": %s,
"nickname": %s,
"email": %s,
"is_disabled": {
"type": "boolean"
@ -30,7 +29,7 @@ func CreateUser() string {
"properties": {
"type": {
"type": "string",
"pattern": "^password$"
"pattern": "^local$"
},
"secret": %s
}
@ -38,5 +37,5 @@ func CreateUser() string {
"capabilities": %s
}
}
`, stringMinMax(2, 100), stringMinMax(2, 100), stringMinMax(5, 150), stringMinMax(8, 255), capabilties())
`, stringMinMax(2, 50), stringMinMax(5, 150), stringMinMax(8, 255), capabilties())
}

View File

@ -18,7 +18,7 @@ func GetToken() string {
"properties": {
"type": {
"type": "string",
"pattern": "^password$"
"enum": ["local", "ldap", "oidc"]
},
"identity": %s,
"secret": %s

View File

@ -3,6 +3,7 @@ package schema
import "fmt"
// SetAuth is the schema for incoming data validation
// Only local auth is supported for setting a password
func SetAuth() string {
return fmt.Sprintf(`
{
@ -15,7 +16,7 @@ func SetAuth() string {
"properties": {
"type": {
"type": "string",
"pattern": "^password$"
"pattern": "^local$"
},
"secret": %s,
"current_secret": %s

View File

@ -11,7 +11,6 @@ func UpdateUser() string {
"minProperties": 1,
"properties": {
"name": %s,
"nickname": %s,
"email": %s,
"is_disabled": {
"type": "boolean"
@ -19,5 +18,5 @@ func UpdateUser() string {
"capabilities": %s
}
}
`, stringMinMax(2, 100), stringMinMax(2, 100), stringMinMax(5, 150), capabilties())
`, stringMinMax(2, 50), stringMinMax(5, 150), capabilties())
}