-
Notifications
You must be signed in to change notification settings - Fork 6
PS-9697 C++ KMIP client library added #19
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
base: master
Are you sure you want to change the base?
PS-9697 C++ KMIP client library added #19
Conversation
1ceb035
to
ecb590a
Compare
The "kmipclient" C++ library implementation is added, that wraps low-level "kmip.h" calls and bypasses mid-level "kmip_bio" level.
ecb590a
to
38e07d8
Compare
@@ -12,6 +12,7 @@ | |||
#include "kmip.h" | |||
#include <openssl/ssl.h> | |||
|
|||
#define LAST_RESULT_MAX_MESSAGE_SIZE 512 //could be big with HasiCorp Vault |
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 believe it is better to use /* <my_comment> */
style in plain-C files.
in the request, and the value specified for Object Group Member is �Group | ||
Member Fresh�, matching candidate objects SHALL be fresh objects from the | ||
in the request, and the value specified for Object Group Member is �Group | ||
Member Fresh�, matching candidate objects SHALL be fresh objects from the |
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.
It seems something went wrong with encoding.
object group. | ||
|
||
If there are no more fresh objects in the group, the server MAY choose to | ||
generate a new object on-the-fly, based on server policy. If the value | ||
specified for Object Group Member is �Group Member Default�, the server locates | ||
specified for Object Group Member is �Group Member Default�, the server locates |
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.
Also an encoding issue
include/Key.hpp | ||
src/StringUtils.cpp | ||
src/StringUtils.hpp | ||
include/Logger.hpp |
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 am not a CMake expert, but I don't think we should list header files in the list of library files.
|
||
The second interface is actual KMIP protocol implementation. It requires a NetClient implementation | ||
as a dependency injection in the constructor. This interface is also similar to the existing C++ wrapper | ||
and can be used the similar whay when properly initialized with the NetClient-derived instance. |
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.
whay
-> way
?
|
||
} // namespace ve | ||
|
||
#else // C++23 or later |
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.
Well, I am struggling to understand what is the difference between implementations of expected
for the C++ standard is less than C++23
branch and the C++23 or later
branch. If such a difference exists, please describe it in the source file as comments.
Why in the first place do we need to implement expected
when C++23 is supported? Could we just use an alias template to the std::expected
?
kmipclient::AttributesFactory::parse (Attribute *attribute, size_t attribute_count) | ||
{ | ||
attributes_t res; | ||
return res; |
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.
Seems to be unimplemented?
int state = 0; | ||
int secret_type = 0; |
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.
Please consider changing types for state
and secret_type
from int
to kmip_entity_state
and kmip_secret_type
respectively.
ids_t res; | ||
for (int i = 0; i < locate_result.ids_size; ++i) | ||
{ | ||
res.emplace_back (locate_result.ids[i]); |
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.
Seems we have double copying. First, we copy strings pld->unique_ids
to locate_result.ids
, then - from locate_result.ids
to res
. Can we eliminated locate_result.ids
and copy straight from pld->unique_ids
to res
?
else | ||
last_result.result_message[0] = 0; | ||
|
||
FILE *mem_stream = open_memstream (&bp, &size); |
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.
Please consider using std::ostringstream
instead of FILE*
for formatted output.
The "kmipclient" C++ library implementation is added, that wraps low-level "kmip.h" calls and bypasses mid-level "kmip_bio" level.