mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-02 03:46:29 +02:00
- cryptutil: add hmac & tests - cryptutil: rename cipher / encoders to be more clear - cryptutil: simplify SecureEncoder interface - cryptutil: renamed NewCipherFromBase64 to NewAEADCipherFromBase64 - cryptutil: move key & random generators to helpers Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
18 lines
552 B
Go
18 lines
552 B
Go
package cryptutil // import "github.com/pomerium/pomerium/internal/cryptutil"
|
|
|
|
// MockEncoder MockCSRFStore is a mock implementation of Cipher.
|
|
type MockEncoder struct {
|
|
MarshalResponse string
|
|
MarshalError error
|
|
UnmarshalError error
|
|
}
|
|
|
|
// Marshal is a mock implementation of MockEncoder.
|
|
func (mc MockEncoder) Marshal(i interface{}) (string, error) {
|
|
return mc.MarshalResponse, mc.MarshalError
|
|
}
|
|
|
|
// Unmarshal is a mock implementation of MockEncoder.
|
|
func (mc MockEncoder) Unmarshal(s string, i interface{}) error {
|
|
return mc.UnmarshalError
|
|
}
|