Skip to content
Snippets Groups Projects
Commit a734a7b8 authored by Rohith's avatar Rohith Committed by GitHub
Browse files

- fixing the mergemap, was using the wrong order (#142)

parent 43d3ada0
Branches
Tags
No related merge requests found
#### **1.2.9**
FIXES:
* Fixed the --headers and --tags command line options, had a typo on the mergeMaps method
BREAKING CHANGES:
* The login handler by default has been switched off, you must enable for --enable-login-handler
* The login handler now enforces the request can only come from a localhost if a client is defined
......
......@@ -496,7 +496,7 @@ func parseCLIOptions(cx *cli.Context, config *Config) (err error) {
if err != nil {
return err
}
mergeMaps(config.MatchClaims, tags)
mergeMaps(config.TagData, tags)
}
if cx.IsSet("match-claims") {
claims, err := decodeKeyPairs(cx.StringSlice("match-claims"))
......@@ -510,7 +510,7 @@ func parseCLIOptions(cx *cli.Context, config *Config) (err error) {
if err != nil {
return err
}
mergeMaps(config.MatchClaims, headers)
mergeMaps(config.Headers, headers)
}
if cx.IsSet("resource") {
for _, x := range cx.StringSlice("resource") {
......
......@@ -435,7 +435,7 @@ func capitalize(s string) string {
//
// mergeMaps simples copies the keys from source to destination
//
func mergeMaps(source, dest map[string]string) map[string]string {
func mergeMaps(dest, source map[string]string) map[string]string {
for k, v := range source {
dest[k] = v
}
......
......@@ -25,9 +25,9 @@ import (
"os"
"reflect"
"testing"
"time"
"github.com/stretchr/testify/assert"
"time"
)
func TestCreateOpenIDClient(t *testing.T) {
......@@ -367,7 +367,7 @@ func TestMergeMaps(t *testing.T) {
},
}
for i, x := range cases {
merged := mergeMaps(x.Source, x.Dest)
merged := mergeMaps(x.Dest, x.Source)
if !reflect.DeepEqual(x.Expected, merged) {
t.Errorf("case %d, expected: %v but got: %v", i, x.Expected, merged)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment