-
Notifications
You must be signed in to change notification settings - Fork 60
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
Code refactoring: Include AgentIdentity #925
base: master
Are you sure you want to change the base?
Code refactoring: Include AgentIdentity #925
Conversation
136d47a
to
ce6d65e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
82e517f
to
b8c4700
Compare
use tss_esapi::traits::Marshall; | ||
|
||
#[derive(Debug)] | ||
pub struct AgentActivation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this structure could be called AgentIdentity
or similar as it is combining all the info that identifies the agent (UUID, keys, certificates, etc.)
Also it raises to me a question: is it possible that this structure containing the agent identity could be useful out of the context of the agent?
To me it seems it could be useful, for example, if we decide to implement other components in Rust in future which could benefit for having the agent identity structure available as a library.
For this reason I believe this structure could be moved to the keylime
library, out of the keylime-agent
application.
Also, I believe that we should modify the current implementation of the RegistrarClient
in the keylime
lib to not include the Agent information, but only the data related with "making requests to the registrar" (e.g. ip
, port
, etc.).
Then, you could move the code from there that is related to building the structure that contains the agent info to your AgentIdentity
structure. Probably using an AgentIdentityBuilder
to set the options.
The register_agent
method in RegistrarClient
could receive an instance of your AgentIdentity
and make the registration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Anderson. Regarding names (AgentActivation->AgentIdentity), I am OK with this.
However, I am still not confident about moving the whole thing to the library, so, if possible, I would like to leave that for another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another issue I find to extract the code of this PR to the library is the usage of certain code which are parts of the agent itself, such as the Error and the Config
Another thing that I would like to ask is to be more descriptive and specific in the PR title, so that when we are going through the PRs, we can get an idea on the changes it is making. "Code refactoring" is not a good title. "Introduce AgentIdentity structure" or "Move agent registration to dedicated module" would be better. |
065c8c3
to
083ce08
Compare
56d9148
to
8b9db7c
Compare
4007e50
to
6eded5b
Compare
6eded5b
to
6cb24ac
Compare
Add agent_registration.rs to include all code relevant to this kind of operation Signed-off-by: Sergio Arroutbi <[email protected]>
6cb24ac
to
c3285ed
Compare
Add agent_registration.rs to include all code
relevant to this kind of operation
Signed-off-by: Sergio Arroutbi [email protected]