diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-09-01 22:28:12 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-09-01 22:28:12 +0100 |
commit | dba3de4451f29fc0b8cb6474b9bbb18ed61d9eac (patch) | |
tree | a7735c443b922735821f1e8af141f46dbb68f1ff /server/signer/signer_test.go | |
parent | 9c58d4d6a324ed8422ef691471868d760b64f7bd (diff) |
Remove the Principal field from the request
The server will always overwrite this field with the username obtained from
the auth provider. Allowing the client to set it is a waste of time.
Diffstat (limited to 'server/signer/signer_test.go')
-rw-r--r-- | server/signer/signer_test.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/server/signer/signer_test.go b/server/signer/signer_test.go index 805f0fc..cdfb4ca 100644 --- a/server/signer/signer_test.go +++ b/server/signer/signer_test.go @@ -27,10 +27,9 @@ func TestCert(t *testing.T) { t.Parallel() r := &lib.SignRequest{ Key: string(testdata.Pub), - Principal: "gopher1", ValidUntil: time.Now().Add(1 * time.Hour), } - cert, err := signer.SignUserKey(r) + cert, err := signer.SignUserKey(r, "gopher1") if err != nil { t.Error(err) } @@ -38,7 +37,7 @@ func TestCert(t *testing.T) { t.Error("Cert signer and server signer don't match") } var principals []string - principals = append(principals, r.Principal) + principals = append(principals, "gopher1") principals = append(principals, signer.principals...) if !reflect.DeepEqual(cert.ValidPrincipals, principals) { t.Errorf("Expected %s, got %s", cert.ValidPrincipals, principals) @@ -57,12 +56,10 @@ func TestRevocationList(t *testing.T) { t.Parallel() r := &lib.SignRequest{ Key: string(testdata.Pub), - Principal: "revoked", ValidUntil: time.Now().Add(1 * time.Hour), } - cert1, _ := signer.SignUserKey(r) - r.Principal = "ok" - cert2, _ := signer.SignUserKey(r) + cert1, _ := signer.SignUserKey(r, "revoked") + cert2, _ := signer.SignUserKey(r, "ok") var rec []*store.CertRecord rec = append(rec, &store.CertRecord{ KeyID: cert1.KeyId, |