MongoDB C++ Driver legacy-1.1.1
Loading...
Searching...
No Matches
sasl_client_authenticate.h
1/* Copyright 2012 10gen Inc.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#pragma once
17
18#include "mongo/base/status.h"
19#include "mongo/bson/bsontypes.h"
21#include "mongo/client/export_macros.h"
22
23namespace mongo {
24class BSONObj;
25
58extern MONGO_CLIENT_API Status(MONGO_CLIENT_FUNC* saslClientAuthenticate)(
59 DBClientWithCommands* client, const BSONObj& saslParameters);
60
70MONGO_CLIENT_API Status MONGO_CLIENT_FUNC
71saslExtractPayload(const BSONObj& cmdObj, std::string* payload, BSONType* type);
72
73// Constants
74
76extern MONGO_CLIENT_API const char* const saslStartCommandName;
77
79extern MONGO_CLIENT_API const char* const saslContinueCommandName;
80
83extern MONGO_CLIENT_API const char* const saslCommandAutoAuthorizeFieldName;
84
86extern MONGO_CLIENT_API const char* const saslCommandCodeFieldName;
87
90extern MONGO_CLIENT_API const char* const saslCommandConversationIdFieldName;
91
94extern MONGO_CLIENT_API const char* const saslCommandDoneFieldName;
95
97extern MONGO_CLIENT_API const char* const saslCommandErrmsgFieldName;
98
100extern MONGO_CLIENT_API const char* const saslCommandMechanismFieldName;
101
104extern MONGO_CLIENT_API const char* const saslCommandMechanismListFieldName;
105
107extern MONGO_CLIENT_API const char* const saslCommandPasswordFieldName;
108
110extern MONGO_CLIENT_API const char* const saslCommandPayloadFieldName;
111
114extern MONGO_CLIENT_API const char* const saslCommandUserFieldName;
115
118extern MONGO_CLIENT_API const char* const saslCommandUserDBFieldName;
119
122extern MONGO_CLIENT_API const char* const saslCommandServiceHostnameFieldName;
123
125extern MONGO_CLIENT_API const char* const saslCommandServiceNameFieldName;
126
128extern MONGO_CLIENT_API const char* const saslDefaultDBName;
129
131extern MONGO_CLIENT_API const char* const saslDefaultServiceName;
132
133// Field whose value should be set to true if the field in saslCommandPasswordFieldName needs to
134// be digested.
135extern MONGO_CLIENT_API const char* const saslCommandDigestPasswordFieldName;
136}
C++ representation of a "BSON" object – that is, an extended JSON-style object in a binary representa...
Definition bsonobj.h:78
DB "commands" Basically just invocations of connection.
Definition dbclientinterface.h:771
Status represents an error state or the absence thereof.
Definition status.h:50
Core MongoDB C++ driver interfaces are defined here.
Utility functions for parsing numbers from strings.
Definition compare_numbers.h:32
MONGO_CLIENT_API const char *const saslCommandMechanismFieldName
Name of parameter to saslStart command indiciating the client's desired sasl mechanism.
MONGO_CLIENT_API const char *const saslCommandErrmsgFieldName
Field in which to store error messages associated with non-success return codes.
MONGO_CLIENT_API const char *const saslCommandCodeFieldName
Name of the field contain the status code in responses from the server.
MONGO_CLIENT_API const char *const saslCommandDoneFieldName
Name of the field that indicates whether or not the server believes authentication has completed succ...
MONGO_CLIENT_API const char *const saslCommandServiceNameFieldName
Field overriding the name of the mongodb service saslClientAuthenticate().
MONGO_CLIENT_API const char *const saslCommandPasswordFieldName
Field containing password information for saslClientAuthenticate().
MONGO_CLIENT_API const char *const saslCommandUserDBFieldName
Field containing the string identifier of the database containing credential information,...
MONGO_CLIENT_API const char *const saslStartCommandName
String name of the saslStart command.
MONGO_CLIENT_API const char *const saslCommandServiceHostnameFieldName
Field overriding the FQDN of the hostname hosting the mongodb srevice in saslClientAuthenticate().
MONGO_CLIENT_API const char *const saslCommandConversationIdFieldName
Name of the field containing the conversation identifier in server respones and saslContinue commands...
MONGO_CLIENT_API const char *const saslContinueCommandName
String name of the saslContinue command.
MONGO_CLIENT_API const char *const saslCommandMechanismListFieldName
In the event that saslStart supplies an unsupported mechanism, the server responds with a field by th...
MONGO_CLIENT_API const char *const saslDefaultDBName
Default database against which sasl authentication commands should run.
MONGO_CLIENT_API const char *const saslCommandUserFieldName
Field containing the string identifier of the user to authenticate in saslClientAuthenticate().
BSONType
the complete list of valid BSON types see also bsonspec.org
Definition bsontypes.h:38
MONGO_CLIENT_API const char *const saslCommandPayloadFieldName
Field containing sasl payloads passed to and from the server.
MONGO_CLIENT_API Status MONGO_CLIENT_FUNC saslExtractPayload(const BSONObj &cmdObj, std::string *payload, BSONType *type)
Extracts the payload field from "cmdObj", and store it into "*payload".
MONGO_CLIENT_API const char *const saslCommandAutoAuthorizeFieldName
Name of the saslStart parameter indicating that the server should automatically grant the connection ...
MONGO_CLIENT_API const char *const saslDefaultServiceName
Default sasl service name, "mongodb".