Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
keystore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
id
keystore
Commits
3e61e87d
Commit
3e61e87d
authored
2 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Attempt to fix partial config parsing issue
Using a *yaml.Node does not work.
parent
455ca882
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
backend/backend.go
+2
-2
2 additions, 2 deletions
backend/backend.go
dovecot/keyproxy.go
+2
-2
2 additions, 2 deletions
dovecot/keyproxy.go
dovecot/keyproxy_test.go
+3
-4
3 additions, 4 deletions
dovecot/keyproxy_test.go
server/keystore.go
+2
-2
2 additions, 2 deletions
server/keystore.go
with
9 additions
and
10 deletions
backend/backend.go
+
2
−
2
View file @
3e61e87d
...
@@ -16,5 +16,5 @@ type Database interface {
...
@@ -16,5 +16,5 @@ type Database interface {
// Config is how users configure a database backend.
// Config is how users configure a database backend.
type
Config
struct
{
type
Config
struct
{
Type
string
`yaml:"type"`
Type
string
`yaml:"type"`
Params
*
yaml
.
Node
`yaml:"params"`
Params
yaml
.
Node
`yaml:"params"`
}
}
This diff is collapsed.
Click to expand it.
dovecot/keyproxy.go
+
2
−
2
View file @
3e61e87d
...
@@ -98,9 +98,9 @@ func NewKeyLookupProxy(config *Config) (*KeyLookupProxy, error) {
...
@@ -98,9 +98,9 @@ func NewKeyLookupProxy(config *Config) (*KeyLookupProxy, error) {
var
db
backend
.
Database
var
db
backend
.
Database
switch
config
.
Backend
.
Type
{
switch
config
.
Backend
.
Type
{
case
"ldap"
:
case
"ldap"
:
db
,
err
=
ldapBE
.
New
(
config
.
Backend
.
Params
)
db
,
err
=
ldapBE
.
New
(
&
config
.
Backend
.
Params
)
case
"sql"
:
case
"sql"
:
db
,
err
=
sqlBE
.
New
(
config
.
Backend
.
Params
)
db
,
err
=
sqlBE
.
New
(
&
config
.
Backend
.
Params
)
default
:
default
:
err
=
errors
.
New
(
"unknown backend type"
)
err
=
errors
.
New
(
"unknown backend type"
)
}
}
...
...
This diff is collapsed.
Click to expand it.
dovecot/keyproxy_test.go
+
3
−
4
View file @
3e61e87d
...
@@ -44,11 +44,10 @@ func withTestDB(t testing.TB, schema string) (func(), string) {
...
@@ -44,11 +44,10 @@ func withTestDB(t testing.TB, schema string) (func(), string) {
},
dbPath
},
dbPath
}
}
func
makeMapSlice
(
m
map
[
string
]
interface
{})
*
yaml
.
Node
{
func
makeMapSlice
(
m
map
[
string
]
interface
{})
(
out
yaml
.
Node
)
{
var
out
yaml
.
Node
d
,
_
:=
yaml
.
Marshal
(
m
)
d
,
_
:=
yaml
.
Marshal
(
m
)
yaml
.
Unmarshal
(
d
,
&
out
)
yaml
.
Unmarshal
(
d
,
&
out
)
// nolint: errcheck
return
&
out
return
}
}
var
(
var
(
...
...
This diff is collapsed.
Click to expand it.
server/keystore.go
+
2
−
2
View file @
3e61e87d
...
@@ -106,9 +106,9 @@ func NewKeyStore(config *Config) (*KeyStore, error) {
...
@@ -106,9 +106,9 @@ func NewKeyStore(config *Config) (*KeyStore, error) {
var
err
error
var
err
error
switch
config
.
Backend
.
Type
{
switch
config
.
Backend
.
Type
{
case
"ldap"
:
case
"ldap"
:
db
,
err
=
ldapBE
.
New
(
config
.
Backend
.
Params
)
db
,
err
=
ldapBE
.
New
(
&
config
.
Backend
.
Params
)
case
"sql"
:
case
"sql"
:
db
,
err
=
sqlBE
.
New
(
config
.
Backend
.
Params
)
db
,
err
=
sqlBE
.
New
(
&
config
.
Backend
.
Params
)
default
:
default
:
err
=
errors
.
New
(
"unknown backend type"
)
err
=
errors
.
New
(
"unknown backend type"
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment