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:
rupinder-syngh
2025-03-21 19:23:40 +05:30
committed by GitHub
parent d6ba0edb27
commit c5bfd0a122
6 changed files with 441 additions and 1 deletions

View 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)
}