MongoDB  2.7.0
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 (*saslClientAuthenticate)(DBClientWithCommands* client,
59  const BSONObj& saslParameters);
60 
70  Status MONGO_CLIENT_API saslExtractPayload(const BSONObj& cmdObj, std::string* payload, BSONType* type);
71 
72  // Constants
73 
75  extern MONGO_CLIENT_API const char* const saslStartCommandName;
76 
78  extern MONGO_CLIENT_API const char* const saslContinueCommandName;
79 
82  extern MONGO_CLIENT_API const char* const saslCommandAutoAuthorizeFieldName;
83 
85  extern MONGO_CLIENT_API const char* const saslCommandCodeFieldName;
86 
89  extern MONGO_CLIENT_API const char* const saslCommandConversationIdFieldName;
90 
93  extern MONGO_CLIENT_API const char* const saslCommandDoneFieldName;
94 
96  extern MONGO_CLIENT_API const char* const saslCommandErrmsgFieldName;
97 
99  extern MONGO_CLIENT_API const char* const saslCommandMechanismFieldName;
100 
103  extern MONGO_CLIENT_API const char* const saslCommandMechanismListFieldName;
104 
106  extern MONGO_CLIENT_API const char* const saslCommandPasswordFieldName;
107 
109  extern MONGO_CLIENT_API const char* const saslCommandPayloadFieldName;
110 
113  extern MONGO_CLIENT_API const char* const saslCommandUserFieldName;
114 
117  extern MONGO_CLIENT_API const char* const saslCommandUserDBFieldName;
118 
121  extern MONGO_CLIENT_API const char* const saslCommandServiceHostnameFieldName;
122 
124  extern MONGO_CLIENT_API const char* const saslCommandServiceNameFieldName;
125 
127  extern MONGO_CLIENT_API const char* const saslDefaultDBName;
128 
130  extern MONGO_CLIENT_API const char* const saslDefaultServiceName;
131 
132  // Field whose value should be set to true if the field in saslCommandPasswordFieldName needs to
133  // be digested.
134  extern MONGO_CLIENT_API const char* const saslCommandDigestPasswordFieldName;
135 }
const char *const saslCommandErrmsgFieldName
Field in which to store error messages associated with non-success return codes.
Definition: sasl_client_authenticate.cpp:38
const char *const saslCommandServiceHostnameFieldName
Field overriding the FQDN of the hostname hosting the mongodb srevice in saslClientAuthenticate().
Definition: sasl_client_authenticate.cpp:45
const char *const saslDefaultServiceName
Default sasl service name, "mongodb".
Definition: sasl_client_authenticate.cpp:49
const char *const saslCommandCodeFieldName
Name of the field contain the status code in responses from the server.
Definition: sasl_client_authenticate.cpp:35
const char *const saslCommandPasswordFieldName
Field containing password information for saslClientAuthenticate().
Definition: sasl_client_authenticate.cpp:41
const char *const saslCommandConversationIdFieldName
Name of the field containing the conversation identifier in server respones and saslContinue commands...
Definition: sasl_client_authenticate.cpp:36
const char *const saslCommandMechanismListFieldName
In the event that saslStart supplies an unsupported mechanism, the server responds with a field by th...
Definition: sasl_client_authenticate.cpp:40
Status(* saslClientAuthenticate)(DBClientWithCommands *client, const BSONObj &saslParameters)
Attempts to authenticate "client" using the SASL protocol.
Definition: sasl_client_authenticate.cpp:29
const char *const saslCommandUserFieldName
Field containing the string identifier of the user to authenticate in saslClientAuthenticate().
Definition: sasl_client_authenticate.cpp:44
BSONType
the complete list of valid BSON types see also bsonspec.org
Definition: bsontypes.h:43
Core MongoDB C++ driver interfaces are defined here.
Status saslExtractPayload(const BSONObj &cmdObj, std::string *payload, BSONType *type)
Extracts the payload field from "cmdObj", and store it into "*payload".
Definition: sasl_client_authenticate.cpp:51
const char *const saslStartCommandName
String name of the saslStart command.
Definition: sasl_client_authenticate.cpp:32
const char *const saslCommandPayloadFieldName
Field containing sasl payloads passed to and from the server.
Definition: sasl_client_authenticate.cpp:42
const char *const saslCommandServiceNameFieldName
Field overriding the name of the mongodb service saslClientAuthenticate().
Definition: sasl_client_authenticate.cpp:46
const char *const saslDefaultDBName
Default database against which sasl authentication commands should run.
Definition: sasl_client_authenticate.cpp:48
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.
Definition: sasl_client_authenticate.cpp:43
const char *const saslCommandMechanismFieldName
Name of parameter to saslStart command indiciating the client's desired sasl mechanism.
Definition: sasl_client_authenticate.cpp:39
const char *const saslContinueCommandName
String name of the saslContinue command.
Definition: sasl_client_authenticate.cpp:33
const char *const saslCommandDoneFieldName
Name of the field that indicates whether or not the server believes authentication has completed succ...
Definition: sasl_client_authenticate.cpp:37
const char *const saslCommandAutoAuthorizeFieldName
Name of the saslStart parameter indicating that the server should automatically grant the connection ...
Definition: sasl_client_authenticate.cpp:34