X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=util_saml.h;h=0a14d3e2ad1d1f6cef051cf70d6b928631ed687a;hb=e063ba4e45d12dbc1a397653f9e77228835e4a2b;hp=984af6ad217ddf34467b05ab27b22cfbe3c935ad;hpb=8190040e84d49e0f01dabae14b4e30f0efe05da6;p=mech_eap.git diff --git a/util_saml.h b/util_saml.h index 984af6a..0a14d3e 100644 --- a/util_saml.h +++ b/util_saml.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, JANET(UK) + * Copyright (c) 2011, JANET(UK) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,6 +30,10 @@ * SUCH DAMAGE. */ +/* + * SAML attribute provider. + */ + #ifndef _UTIL_SAML_H_ #define _UTIL_SAML_H_ 1 @@ -55,10 +59,10 @@ public: const gss_ctx_id_t ctx); bool getAttributeTypes(gss_eap_attr_enumeration_cb, void *data) const; - void setAttribute(int complete, + bool setAttribute(int complete, const gss_buffer_t attr, const gss_buffer_t value); - void deleteAttribute(const gss_buffer_t value); + bool deleteAttribute(const gss_buffer_t value); bool getAttribute(const gss_buffer_t attr, int *authenticated, int *complete, @@ -70,11 +74,19 @@ public: void releaseAnyNameMapping(gss_buffer_t type_id, gss_any_t input) const; - void exportToBuffer(gss_buffer_t buffer) const; - bool initFromBuffer(const gss_eap_attr_ctx *ctx, - const gss_buffer_t buffer); + const char *prefix(void) const; + const char *name(void) const { return NULL; } + bool initWithJsonObject(const gss_eap_attr_ctx *manager GSSEAP_UNUSED, + json_t *object GSSEAP_UNUSED) { + return false; + } + json_t *jsonRepresentation(void) const { + return NULL; + } - const opensaml::saml2::Assertion *getAssertion(void) const { + opensaml::saml2::Assertion *initAssertion(void); + + opensaml::saml2::Assertion *getAssertion(void) const { return m_assertion; } bool authenticated(void) const { @@ -82,9 +94,10 @@ public: } time_t getExpiryTime(void) const; + OM_uint32 mapException(OM_uint32 *minor, std::exception &e) const; - static bool init(); - static void finalize(); + static bool init(void); + static void finalize(void); static gss_eap_attr_provider *createAttrContext(void); @@ -107,10 +120,10 @@ public: ~gss_eap_saml_attr_provider(void) {} bool getAttributeTypes(gss_eap_attr_enumeration_cb, void *data) const; - void setAttribute(int complete, + bool setAttribute(int complete, const gss_buffer_t attr, const gss_buffer_t value); - void deleteAttribute(const gss_buffer_t value); + bool deleteAttribute(const gss_buffer_t value); bool getAttribute(const gss_buffer_t attr, int *authenticated, int *complete, @@ -122,19 +135,28 @@ public: void releaseAnyNameMapping(gss_buffer_t type_id, gss_any_t input) const; - void exportToBuffer(gss_buffer_t buffer) const; - bool initFromBuffer(const gss_eap_attr_ctx *ctx, - const gss_buffer_t buffer); + const char *prefix(void) const; + const char *name(void) const { + return NULL; + } + bool initWithJsonObject(const gss_eap_attr_ctx *manager GSSEAP_UNUSED, + json_t *object GSSEAP_UNUSED) { + return false; + } + json_t *jsonRepresentation(void) const { + return NULL; + } bool getAttribute(const gss_buffer_t attr, int *authenticated, int *complete, const opensaml::saml2::Attribute **pAttribute) const; bool getAssertion(int *authenticated, - const opensaml::saml2::Assertion **pAssertion) const; + opensaml::saml2::Assertion **pAssertion, + bool createIfAbsent = false) const; - static bool init(); - static void finalize(); + static bool init(void); + static void finalize(void); static gss_eap_attr_provider *createAttrContext(void);