feat: decryption plugin (#430)
* feat: Implemented decryption plugin * fix: Removed interface test file * fix: Test case * fix: Test case for plugin * fix: test case change * fix: resolved pr comments * fix: resolved pr comments * fix: removed mock dcrypter * fix: formatting * fix: removed config, close function, enhanced test cases * fix: test cases enhancement, formatting
This commit is contained in:
15
pkg/plugin/definition/decrypter.go
Normal file
15
pkg/plugin/definition/decrypter.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package definition
|
||||
|
||||
import "context"
|
||||
|
||||
// Decrypter defines the methods for decryption.
|
||||
type Decrypter interface {
|
||||
// Decrypt decrypts the given body using the provided privateKeyBase64 and publicKeyBase64.
|
||||
Decrypt(ctx context.Context, encryptedData string, privateKeyBase64, publicKeyBase64 string) (string, error)
|
||||
}
|
||||
|
||||
// DecrypterProvider initializes a new decrypter instance with the given config.
|
||||
type DecrypterProvider interface {
|
||||
// New creates a new decrypter instance based on the provided config.
|
||||
New(ctx context.Context, config map[string]string) (Decrypter, func() error, error)
|
||||
}
|
||||
Reference in New Issue
Block a user