sasl.h
Go to the documentation of this file.
#ifndef PROTON_SASL_H
#define PROTON_SASL_H 1
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
#include <proton/import_export.h>
#include <proton/type_compat.h>
#include <proton/types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct pn_sasl_t pn_sasl_t;
typedef enum {
PN_SASL_NONE = -1,
PN_SASL_OK = 0,
PN_SASL_AUTH = 1,
PN_SASL_SYS = 2,
PN_SASL_PERM = 3,
PN_SASL_TEMP = 4
} pn_sasl_outcome_t;
PN_EXTERN pn_sasl_t *pn_sasl(pn_transport_t *transport);
PN_EXTERN bool pn_sasl_extended(void);
PN_EXTERN void pn_sasl_done(pn_sasl_t *sasl, pn_sasl_outcome_t outcome);
PN_EXTERN pn_sasl_outcome_t pn_sasl_outcome(pn_sasl_t *sasl);
PN_EXTERN const char *pn_sasl_get_user(pn_sasl_t *sasl);
PN_EXTERN const char *pn_sasl_get_mech(pn_sasl_t *sasl);
PN_EXTERN void pn_sasl_allowed_mechs(pn_sasl_t *sasl, const char *mechs);
PN_EXTERN void pn_sasl_set_allow_insecure_mechs(pn_sasl_t *sasl, bool insecure);
PN_EXTERN bool pn_sasl_get_allow_insecure_mechs(pn_sasl_t *sasl);
PN_EXTERN void pn_sasl_config_name(pn_sasl_t *sasl, const char *name);
PN_EXTERN void pn_sasl_config_path(pn_sasl_t *sasl, const char *path);
#ifdef __cplusplus
}
#endif
#endif /* sasl.h */
PN_SASL_OK
negotiation not completed
Definition: sasl.h:56
pn_sasl_get_allow_insecure_mechs
bool pn_sasl_get_allow_insecure_mechs(pn_sasl_t *sasl)
Return the current value for allow_insecure_mechs.
types.h
PN_SASL_TEMP
failed due to unrecoverable error
Definition: sasl.h:60
pn_sasl_get_user
const char * pn_sasl_get_user(pn_sasl_t *sasl)
Retrieve the authenticated user.
PN_SASL_SYS
failed due to bad credentials
Definition: sasl.h:58
pn_sasl_set_allow_insecure_mechs
void pn_sasl_set_allow_insecure_mechs(pn_sasl_t *sasl, bool insecure)
Boolean to allow use of clear text authentication mechanisms.
pn_transport_t
struct pn_transport_t pn_transport_t
A network channel supporting an AMQP connection.
Definition: types.h:431
pn_sasl_extended
bool pn_sasl_extended(void)
Do we support extended SASL negotiation.
pn_sasl_outcome
pn_sasl_outcome_t pn_sasl_outcome(pn_sasl_t *sasl)
Retrieve the outcome of SASL negotiation.
pn_sasl_outcome_t
pn_sasl_outcome_t
The result of the SASL negotiation.
Definition: sasl.h:54
PN_SASL_AUTH
authentication succeeded
Definition: sasl.h:57
pn_sasl_config_name
void pn_sasl_config_name(pn_sasl_t *sasl, const char *name)
Set the sasl configuration name.
pn_sasl_allowed_mechs
void pn_sasl_allowed_mechs(pn_sasl_t *sasl, const char *mechs)
SASL mechanisms that are to be considered for authentication.
pn_sasl_config_path
void pn_sasl_config_path(pn_sasl_t *sasl, const char *path)
Set the sasl configuration path.
PN_SASL_PERM
failed due to a system error
Definition: sasl.h:59
pn_sasl_t
struct pn_sasl_t pn_sasl_t
The SASL layer is responsible for establishing an authenticated and/or encrypted tunnel over which AM...
Definition: sasl.h:49
pn_sasl_get_mech
const char * pn_sasl_get_mech(pn_sasl_t *sasl)
Return the selected SASL mechanism.
pn_sasl
pn_sasl_t * pn_sasl(pn_transport_t *transport)
Construct an Authentication and Security Layer object.
pn_sasl_done
void pn_sasl_done(pn_sasl_t *sasl, pn_sasl_outcome_t outcome)
Set the outcome of SASL negotiation.