Commit 52941c39 52941c39826b6fba2792d5ebc085b83d4e68d06c by Sam Roberts

authority_create_null(): creates an authority that successfully does

nothing, useful for concrete types that need to return an authority, but
don't do any authentication.
1 parent 430c396c
......@@ -60,6 +60,8 @@ extern int authority_get_ticket __P ((authority_t, ticket_t *));
extern int authority_authenticate __P ((authority_t));
extern int authority_set_authenticate __P ((authority_t, int (*_authenticate) __P ((authority_t)), void *));
extern int authority_create_null __P ((authority_t *pauthority, void *owner));
struct _wicket;
typedef struct _wicket *wicket_t;
......
......@@ -26,6 +26,23 @@
#include <auth0.h>
static int
_authenticate_null (authority_t auth)
{
(void) auth;
return 0;
}
int
authority_create_null (authority_t *pauthority, void *owner)
{
int rc = authority_create(pauthority, NULL, owner);
if(rc)
return rc;
(*pauthority)->_authenticate = _authenticate_null;
return 0;
}
int
authority_create (authority_t *pauthority, ticket_t ticket, void *owner)
{
......