Add a test that checks if all tokens and attributes are returned to the access control plugin

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
This commit is contained in:
Dennis Potman 2020-05-12 20:28:11 +02:00 committed by eboasson
parent cf75263d1d
commit edcbe1b22e
10 changed files with 260 additions and 34 deletions

View file

@ -109,8 +109,8 @@ struct reader_sec_attributes {
bool plugin_attr;
};
struct dds_security_authentication *q_omg_participant_get_authentication(const struct participant *pp);
DDS_EXPORT struct dds_security_access_control *q_omg_participant_get_access_control(const struct participant *pp);
DDS_EXPORT struct dds_security_authentication *q_omg_participant_get_authentication(const struct participant *pp);
DDS_EXPORT struct dds_security_cryptography *q_omg_participant_get_cryptography(const struct participant *pp);
void q_omg_vlog_exception(const struct ddsrt_log_cfg *lc, uint32_t cat, DDS_Security_SecurityException *exception, const char *file, uint32_t line, const char *func, const char *fmt, va_list ap);

View file

@ -284,6 +284,13 @@ static struct dds_security_context * q_omg_security_get_secure_context(const str
return NULL;
}
struct dds_security_access_control *q_omg_participant_get_access_control(const struct participant *pp)
{
if (pp && pp->e.gv->security_context && q_omg_is_security_loaded(pp->e.gv->security_context))
return pp->e.gv->security_context->access_control_context;
return NULL;
}
struct dds_security_authentication *q_omg_participant_get_authentication(const struct participant *pp)
{
if (pp && pp->e.gv->security_context && q_omg_is_security_loaded(pp->e.gv->security_context))
@ -291,6 +298,13 @@ struct dds_security_authentication *q_omg_participant_get_authentication(const s
return NULL;
}
struct dds_security_cryptography *q_omg_participant_get_cryptography(const struct participant *pp)
{
if (pp && pp->e.gv->security_context && q_omg_is_security_loaded(pp->e.gv->security_context))
return pp->e.gv->security_context->crypto_context;
return NULL;
}
static struct dds_security_context * q_omg_security_get_secure_context_from_proxypp(const struct proxy_participant *proxypp)
{
if (proxypp && proxypp->e.gv->security_context && q_omg_is_security_loaded(proxypp->e.gv->security_context))
@ -705,13 +719,6 @@ get_first_matched_proxypp_crypto_handle(struct participant_sec_attributes *attr)
return handle;
}
struct dds_security_cryptography *q_omg_participant_get_cryptography(const struct participant *pp)
{
if (pp && pp->e.gv->security_context && q_omg_is_security_loaded(pp->e.gv->security_context))
return pp->e.gv->security_context->crypto_context;
return NULL;
}
bool q_omg_is_security_loaded (dds_security_context *sc)
{
return (sc->crypto_context != NULL || sc->authentication_context != NULL || sc->access_control_context != NULL);