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

support config common aes secret #1683

Merged
merged 2 commits into from
Mar 26, 2024
Merged

support config common aes secret #1683

merged 2 commits into from
Mar 26, 2024

Conversation

tomsun28
Copy link
Contributor

What's changed?

support config common aes secret

Checklist

  • I hereby agree to the terms of the HertzBeat CLA
  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

Signed-off-by: tomsun28 <tomsun28@outlook.com>
@tomsun28
Copy link
Contributor Author

todo, consider not init cipher in AesUtil every time and test performance

@ZY945
Copy link
Member

ZY945 commented Mar 25, 2024

todo, consider not init cipher in AesUtil every time and test performance

Does this mean using singleton (not every initialization)?

@tomsun28
Copy link
Contributor Author

Does this mean using singleton (not every initialization)?

image

here we init cipher every time, want to try just initialize the cipher once and then support its use by multiple threads safely.

@ZY945
Copy link
Member

ZY945 commented Mar 25, 2024

Does this mean using singleton (not every initialization)?

image here we init `cipher` every time, want to try just initialize the `cipher` once and then support its use by multiple threads safely.

image
I found a place to set the SecretKey, and we can try initializing Cipher by putting it into the setDefultSecretKey method.

@tomsun28
Copy link
Contributor Author

I found a place to set the SecretKey, and we can try initializing Cipher by putting it into the setDefultSecretKey method.

yes, and we should consider the situation that not setDefultSecretKey when startup.

@ZY945
Copy link
Member

ZY945 commented Mar 25, 2024

I found a place to set the SecretKey, and we can try initializing Cipher by putting it into the setDefultSecretKey method.

yes, and we should consider the situation that not setDefultSecretKey when startup.

image
image
image
Is this method okay? A single instance of double check lock

@tomsun28
Copy link
Contributor Author

Is this method okay? A single instance of double check lock

👍okay. also need in encode method. Suggest we add unit test to test it and put it anothor new pr.

Copy link
Member

@ZY945 ZY945 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ZY945 ZY945 merged commit 9698877 into master Mar 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants