burn some logs

This commit is contained in:
AJ ONeal 2020-05-11 04:58:12 +00:00
parent 83a5642829
commit d914325e2f
1 changed files with 5 additions and 8 deletions

View File

@ -33,7 +33,7 @@ type PublicJWK struct {
} }
type InspectableToken struct { type InspectableToken struct {
Public keypairs.PublicKey `json:"public"` Public keypairs.PublicKey `json:"jwk"`
Protected map[string]interface{} `json:"protected"` Protected map[string]interface{} `json:"protected"`
Payload map[string]interface{} `json:"payload"` Payload map[string]interface{} `json:"payload"`
Signature string `json:"signature"` Signature string `json:"signature"`
@ -47,7 +47,7 @@ func (t *InspectableToken) MarshalJSON() ([]byte, error) {
payload, _ := json.Marshal(t.Payload) payload, _ := json.Marshal(t.Payload)
errs, _ := json.Marshal(t.Errors) errs, _ := json.Marshal(t.Errors)
return []byte(fmt.Sprintf( return []byte(fmt.Sprintf(
`{"public":%s,"protected":%s,"payload":%s,"signature":%q,"verified":%t,"errors":%s}`, `{"jwk":%s,"protected":%s,"payload":%s,"signature":%q,"verified":%t,"errors":%s}`,
pub, header, payload, t.Signature, t.Verified, errs, pub, header, payload, t.Signature, t.Verified, errs,
)), nil )), nil
} }
@ -217,14 +217,11 @@ func Route(jwksPrefix string, privkey keypairs.PrivateKey) {
Errors: errors, Errors: errors,
} }
tokenB, err := json.MarshalIndent(inspected, "", " ") tokenB, _ := json.MarshalIndent(inspected, "", " ")
if nil != err { if nil != err {
fmt.Println("couldn't serialize inpsected token:") http.Error(w, "Bad Format: malformed token, or malformed jwk at issuer url", http.StatusInternalServerError)
fmt.Println(err) return
} }
fmt.Println("serialized inpsected token")
fmt.Println(inspected)
fmt.Println(string(tokenB))
fmt.Fprintf(w, string(tokenB)) fmt.Fprintf(w, string(tokenB))
}) })