mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-21 14:28:54 -04:00
api: refine signature types
Wrapping apiObject does not work as intended as the version field is when fetching objects from the API. Thus we need to insert the target path of the signature directly.
This commit is contained in:
parent
7ffa1344e3
commit
2b19632e09
7 changed files with 81 additions and 25 deletions
|
@ -89,3 +89,33 @@ gCDlEzkuOCybCHf+q766bve799L7Y5y5oRsHY1MrUCUwYF/tL7Sg7EYMsA==
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsBase64(t *testing.T) {
|
||||
tests := map[string]struct {
|
||||
signature []byte
|
||||
wantErr bool
|
||||
}{
|
||||
"valid base64": {
|
||||
signature: []byte("SGVsbG8gV29ybGQ="),
|
||||
wantErr: false,
|
||||
},
|
||||
"invalid base64": {
|
||||
signature: []byte("not base64"),
|
||||
wantErr: true,
|
||||
},
|
||||
"empty input": {
|
||||
signature: []byte{},
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
|
||||
for tc, tt := range tests {
|
||||
t.Run(tc, func(t *testing.T) {
|
||||
err := IsBase64(tt.signature)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("IsBase64() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue