Couchbase C Client  3.1.0
Asynchronous C Client for Couchbase
auth.h
Go to the documentation of this file.
1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3  * Copyright 2017-2020 Couchbase, Inc.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef LCB_AUTH_H
19 #define LCB_AUTH_H
20 
26 #ifdef __cplusplus
27 namespace lcb
28 {
29 class Authenticator;
30 }
31 typedef lcb::Authenticator lcb_AUTHENTICATOR;
32 extern "C" {
33 #else /* C only! */
34 typedef struct lcb_AUTHENTICATOR_Cdummy lcb_AUTHENTICATOR;
35 #endif
36 
142 LIBCOUCHBASE_API
144 
148 typedef enum {
151 
157  LCBAUTH_F_BUCKET = 1 << 2
159 
181 LIBCOUCHBASE_API
182 lcb_STATUS lcbauth_add_pass(lcb_AUTHENTICATOR *auth, const char *user, const char *pass, int flags);
183 
194 LIBCOUCHBASE_API
196 
205 LIBCOUCHBASE_API
207 
219 LIBCOUCHBASE_API
221 
233 typedef const char *(*lcb_AUTHCALLBACK)(void *cookie, const char *host, const char *port, const char *bucket);
234 
245 LIBCOUCHBASE_API
246 lcb_STATUS lcbauth_set_callbacks(lcb_AUTHENTICATOR *auth, void *cookie, lcb_AUTHCALLBACK usercb,
247  lcb_AUTHCALLBACK passcb);
248 
249 typedef enum {
255 
264 
271  LCBAUTH_MODE_DYNAMIC = 2
272 } lcbauth_MODE;
273 
286 LIBCOUCHBASE_API
288 
291 #ifdef __cplusplus
292 }
293 #endif
294 #endif /* LCB_AUTH_H */
LCBAUTH_F_BUCKET
@ LCBAUTH_F_BUCKET
User is bucket name.
Definition: auth.h:157
lcbauth_clone
lcb_AUTHENTICATOR * lcbauth_clone(const lcb_AUTHENTICATOR *src)
lcbauth_ADDPASSFLAGS
lcbauth_ADDPASSFLAGS
Flags to use when adding a new set of credentials to lcbauth_add_pass.
Definition: auth.h:148
lcb_AUTHENTICATOR
Opaque pointer containing credentials for the library.
lcbauth_set_mode
lcb_STATUS lcbauth_set_mode(lcb_AUTHENTICATOR *src, lcbauth_MODE mode)
LCBAUTH_F_CLUSTER
@ LCBAUTH_F_CLUSTER
User/Password is administrative; for cluster.
Definition: auth.h:150
LCBAUTH_MODE_CLASSIC
@ LCBAUTH_MODE_CLASSIC
Use "bucket-specific" credentials when authenticating.
Definition: auth.h:254
lcbauth_MODE
lcbauth_MODE
Definition: auth.h:249
lcbauth_new
lcb_AUTHENTICATOR * lcbauth_new(void)
LCBAUTH_MODE_RBAC
@ LCBAUTH_MODE_RBAC
Use role-based access control.
Definition: auth.h:263
lcb_STATUS
lcb_STATUS
Error codes returned by the library.
Definition: error.h:209
lcbauth_ref
void lcbauth_ref(lcb_AUTHENTICATOR *auth)
lcbauth_unref
void lcbauth_unref(lcb_AUTHENTICATOR *auth)
lcbauth_add_pass
lcb_STATUS lcbauth_add_pass(lcb_AUTHENTICATOR *auth, const char *user, const char *pass, int flags)