feat: encryption plugin (#429)

* feat: Implement encryption plugin.

* fix: Removed interface test file

* fix: Test case changes

* fix: Test case for encryption

* fix: formatting changes

* fix: lint change

* fix: shared renamed to pkg

* fix: shared rename to pkg

* fix: resolved pr comments

* fix: indentation, formatting

* fix: removed config, ctx check, test enhancements

* fix: removed close function

* fix: remove config and enhance test cases

* fix: formatting changes, test case enhancement
This commit is contained in:
rupinder-syngh
2025-03-21 17:18:51 +05:30
committed by GitHub
parent e07a6cdad9
commit d6ba0edb27
8 changed files with 360 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
package definition
import "context"
// Encrypter defines the methods for encryption.
type Encrypter interface {
// Encrypt encrypts the given body using the provided privateKeyBase64 and publicKeyBase64.
Encrypt(ctx context.Context, data string, privateKeyBase64, publicKeyBase64 string) (string, error)
}
// EncrypterProvider initializes a new encrypter instance with the given config.
type EncrypterProvider interface {
// New creates a new encrypter instance based on the provided config.
New(ctx context.Context, config map[string]string) (Encrypter, func() error, error)
}