MongoDB C++ Driver  legacy-1.1.2
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 
23 namespace mongo {
24 class BSONObj;
25 
58 extern MONGO_CLIENT_API Status(MONGO_CLIENT_FUNC* saslClientAuthenticate)(
59  DBClientWithCommands* client, const BSONObj& saslParameters);
60 
70 MONGO_CLIENT_API Status MONGO_CLIENT_FUNC
71 saslExtractPayload(const BSONObj& cmdObj, std::string* payload, BSONType* type);
72 
73 // Constants
74 
76 extern MONGO_CLIENT_API const char* const saslStartCommandName;
77 
79 extern MONGO_CLIENT_API const char* const saslContinueCommandName;
80 
83 extern MONGO_CLIENT_API const char* const saslCommandAutoAuthorizeFieldName;
84 
86 extern MONGO_CLIENT_API const char* const saslCommandCodeFieldName;
87 
90 extern MONGO_CLIENT_API const char* const saslCommandConversationIdFieldName;
91 
94 extern MONGO_CLIENT_API const char* const saslCommandDoneFieldName;
95 
97 extern MONGO_CLIENT_API const char* const saslCommandErrmsgFieldName;
98 
100 extern MONGO_CLIENT_API const char* const saslCommandMechanismFieldName;
101 
104 extern MONGO_CLIENT_API const char* const saslCommandMechanismListFieldName;
105 
107 extern MONGO_CLIENT_API const char* const saslCommandPasswordFieldName;
108 
110 extern MONGO_CLIENT_API const char* const saslCommandPayloadFieldName;
111 
114 extern MONGO_CLIENT_API const char* const saslCommandUserFieldName;
115 
118 extern MONGO_CLIENT_API const char* const saslCommandUserDBFieldName;
119 
122 extern MONGO_CLIENT_API const char* const saslCommandServiceHostnameFieldName;
123 
125 extern MONGO_CLIENT_API const char* const saslCommandServiceNameFieldName;
126 
128 extern MONGO_CLIENT_API const char* const saslDefaultDBName;
129 
131 extern 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.
135 extern MONGO_CLIENT_API const char* const saslCommandDigestPasswordFieldName;
136 }
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 saslCommandPayloadFieldName
Field containing sasl payloads passed to and from the server.
MONGO_CLIENT_API const char *const saslCommandUserFieldName
Field containing the string identifier of the user to authenticate in saslClientAuthenticate().
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 saslCommandPasswordFieldName
Field containing password information for saslClientAuthenticate().
MONGO_CLIENT_API const char *const saslCommandMechanismFieldName
Name of parameter to saslStart command indiciating the client's desired sasl mechanism.
Utility functions for parsing numbers from strings.
Definition: compare_numbers.h:20
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 saslDefaultDBName
Default database against which sasl authentication commands should run.
MONGO_CLIENT_API const char *const saslCommandServiceNameFieldName
Field overriding the name of the mongodb service saslClientAuthenticate().
MONGO_CLIENT_API const char *const saslStartCommandName
String name of the saslStart command.
BSONType
the complete list of valid BSON types see also bsonspec.org
Definition: bsontypes.h:38
Core MongoDB C++ driver interfaces are defined here.
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 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".
MONGO_CLIENT_API const char *const saslContinueCommandName
String name of the saslContinue command.
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 saslCommandErrmsgFieldName
Field in which to store error messages associated with non-success return codes.
MONGO_CLIENT_API const char *const saslCommandUserDBFieldName
Field containing the string identifier of the database containing credential information, or "$external" if the credential information is stored outside of the mongo cluster.
MONGO_CLIENT_API Status(MONGO_CLIENT_FUNC *saslClientAuthenticate)(DBClientWithCommands *client
Attempts to authenticate "client" using the SASL protocol.
MONGO_CLIENT_API const char *const saslCommandServiceHostnameFieldName
Field overriding the FQDN of the hostname hosting the mongodb srevice in saslClientAuthenticate().