summaryrefslogtreecommitdiff
path: root/internal/configuration/deprecation.go
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2023-05-07 16:39:17 +1000
committerGitHub <noreply@github.com>2023-05-07 16:39:17 +1000
commitfb5c285c2549c344f5b24a1cae1fe724a89f11a0 (patch)
tree8f7dde699a6d1bfffec8413a0f66d566851af9a2 /internal/configuration/deprecation.go
parent90d190121d538318ca2b1358f77b890a1cbe1b9d (diff)
feat(authentication): suport ldap over unix socket (#5397)
This adds support for LDAP unix sockets using the ldapi scheme. In addition it improves all of the address related parsing significantly deprecating old options. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'internal/configuration/deprecation.go')
-rw-r--r--internal/configuration/deprecation.go59
1 files changed, 57 insertions, 2 deletions
diff --git a/internal/configuration/deprecation.go b/internal/configuration/deprecation.go
index 531074462..5fb997a42 100644
--- a/internal/configuration/deprecation.go
+++ b/internal/configuration/deprecation.go
@@ -13,6 +13,7 @@ type Deprecation struct {
Key string
NewKey string
AutoMap bool
+ Keep bool
MapFunc func(value any) any
ErrFunc func(d Deprecation, keysFinal map[string]any, value any, val *schema.StructValidator)
}
@@ -183,9 +184,10 @@ var deprecations = map[string]Deprecation{
Key: "server.host",
NewKey: "server.address",
AutoMap: false,
+ Keep: true,
MapFunc: nil,
ErrFunc: func(d Deprecation, _ map[string]any, _ any, val *schema.StructValidator) {
- val.PushWarning(fmt.Errorf("configuration key 'server.host' is deprecated in %s and has been replaced by 'server.address' when combined with the 'server.port' in the format of 'tcp://<host>:<port>': this should be automatically mapped for you but you will need to adjust your configuration to remove this message", d.Version.String()))
+ val.PushWarning(fmt.Errorf("configuration key 'server.host' is deprecated in %s and has been replaced by 'server.address' when combined with the 'server.port' in the format of '[tcp://]<hostname>[:<port>]': this should be automatically mapped for you but you will need to adjust your configuration to remove this message", d.Version.String()))
},
},
"server.port": {
@@ -193,9 +195,62 @@ var deprecations = map[string]Deprecation{
Key: "server.port",
NewKey: "server.address",
AutoMap: false,
+ Keep: true,
MapFunc: nil,
ErrFunc: func(d Deprecation, _ map[string]any, _ any, val *schema.StructValidator) {
- val.PushWarning(fmt.Errorf("configuration key 'server.port' is deprecated in %s and has been replaced by 'server.address' when combined with the 'server.host' in the format of 'tcp://<host>:<port>': this should be automatically mapped for you but you will need to adjust your configuration to remove this message", d.Version.String()))
+ val.PushWarning(fmt.Errorf("configuration key 'server.port' is deprecated in %s and has been replaced by 'server.address' when combined with the 'server.host' in the format of '[tcp://]<hostname>[:<port>]': this should be automatically mapped for you but you will need to adjust your configuration to remove this message", d.Version.String()))
},
},
+ "storage.mysql.host": {
+ Version: model.SemanticVersion{Major: 4, Minor: 38},
+ Key: "storage.mysql.host",
+ NewKey: "storage.mysql.address",
+ AutoMap: false,
+ Keep: true,
+ MapFunc: nil,
+ ErrFunc: func(d Deprecation, _ map[string]any, _ any, val *schema.StructValidator) {
+ val.PushWarning(fmt.Errorf("configuration key 'storage.mysql.host' is deprecated in %s and has been replaced by 'storage.mysql.address' when combined with the 'storage.mysql.port' in the format of '[tcp://]<hostname>[:<port>]': this should be automatically mapped for you but you will need to adjust your configuration to remove this message", d.Version.String()))
+ },
+ },
+ "storage.mysql.port": {
+ Version: model.SemanticVersion{Major: 4, Minor: 38},
+ Key: "storage.mysql.port",
+ NewKey: "storage.mysql.address",
+ AutoMap: false,
+ Keep: true,
+ MapFunc: nil,
+ ErrFunc: func(d Deprecation, _ map[string]any, _ any, val *schema.StructValidator) {
+ val.PushWarning(fmt.Errorf("configuration key 'storage.mysql.port' is deprecated in %s and has been replaced by 'storage.mysql.address' when combined with the 'storage.mysql.host' in the format of '[tcp://]<hostname>[:<port>]': this should be automatically mapped for you but you will need to adjust your configuration to remove this message", d.Version.String()))
+ },
+ },
+ "storage.postgres.host": {
+ Version: model.SemanticVersion{Major: 4, Minor: 38},
+ Key: "storage.postgres.host",
+ NewKey: "storage.postgres.address",
+ AutoMap: false,
+ Keep: true,
+ MapFunc: nil,
+ ErrFunc: func(d Deprecation, _ map[string]any, _ any, val *schema.StructValidator) {
+ val.PushWarning(fmt.Errorf("configuration key 'storage.postgres.host' is deprecated in %s and has been replaced by 'storage.postgres.address' when combined with the 'storage.postgres.port' in the format of '[tcp://]<hostname>[:<port>]': this should be automatically mapped for you but you will need to adjust your configuration to remove this message", d.Version.String()))
+ },
+ },
+ "storage.postgres.port": {
+ Version: model.SemanticVersion{Major: 4, Minor: 38},
+ Key: "storage.postgres.port",
+ NewKey: "storage.postgres.address",
+ AutoMap: false,
+ Keep: true,
+ MapFunc: nil,
+ ErrFunc: func(d Deprecation, _ map[string]any, _ any, val *schema.StructValidator) {
+ val.PushWarning(fmt.Errorf("configuration key 'storage.postgres.port' is deprecated in %s and has been replaced by 'storage.postgres.address' when combined with the 'storage.postgres.host' in the format of '[tcp://]<hostname>[:<port>]': this should be automatically mapped for you but you will need to adjust your configuration to remove this message", d.Version.String()))
+ },
+ },
+ "authentication_backend.ldap.url": {
+ Version: model.SemanticVersion{Major: 4, Minor: 38},
+ Key: "authentication_backend.ldap.url",
+ NewKey: "authentication_backend.ldap.address",
+ AutoMap: true,
+ MapFunc: nil,
+ ErrFunc: nil,
+ },
}