Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(structured options): refactor methods to accept structured options #13

Merged
merged 7 commits into from
Dec 22, 2021

Conversation

clok
Copy link
Owner

@clok clok commented Dec 21, 2021

Refactored exported methods to use structured options as inputs. This will allow for further extension of features without further modifying the interface.

Examples:

type EncryptOptions struct {
	Body     *[]byte
	Password *[]byte
	VaultID  string
}
type DecryptOptions struct {
	Data     *[]byte
	Password *[]byte
}

I opted to use *[]byte as the data types for sensitive in order to avoid storing data in plaintext via string types as well as avoiding extra copies of the values in memory when passing the data.

I will update the internal methods to accept pointers instead of strings as well.

NOTE: This will coincide with a major version bump to v3.0.0

Signed-off-by: Derek Smith <drsmith.phys@gmail.com>
Signed-off-by: Derek Smith <drsmith.phys@gmail.com>
Signed-off-by: Derek Smith <drsmith.phys@gmail.com>
Signed-off-by: Derek Smith <drsmith.phys@gmail.com>
Signed-off-by: Derek Smith <drsmith.phys@gmail.com>
Signed-off-by: Derek Smith <drsmith.phys@gmail.com>
Signed-off-by: Derek Smith <drsmith.phys@gmail.com>
@clok clok merged commit c63144c into main Dec 22, 2021
@clok clok deleted the feat/refactor-for-v3 branch December 22, 2021 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant