     }
 }
 
-/// Authentication and encryption
+/// Authentication extensions
 extension Database {
     /// Generates a random String
+    ///
+    /// - returns: A random nonce
     private func randomNonce() -> String {
         let allowedCharacters = "!\"#'$%&()*+-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_$"
         

            throw InternalMongoError.IncorrectReply(reply: successResponse)
        }
    }
    
    /// Creates a new user
    /// Warning: Use an SSL socket to create someone for security sake!
    /// Warning: The standard library doesn't have SSL
    /// - parameter user: The user's username
    /// - parameter password: The plaintext password
    /// - parameter customData: The optional custom information to store
    public func createUser(_ user: String, password: String, roles: Document, customData: Document? = nil) throws {
        var command: Document = [
                                "createUser": ~user,

        let document = try firstDocument(in: try execute(command: command))
        
        guard document["ok"].int32 == 1 else {
            throw MongoError.CommandFailure // TODO: Make this more specific
        }
    }
    
    /// Grants roles to a user in this database
    ///
    /// For additional information: https://docs.mongodb.com/manual/reference/command/grantRolesToUser/#dbcmd.grantRolesToUser
    ///
    /// - parameter roles: The roles to grants
    /// - parameter user: The user's username to grant the roles to
    ///
    /// - throws: When we can't send the request/receive the response, you don't have sufficient permissions or an error occurred
    public func grant(roles: Document, to user: String) throws {
        let command: Document = [
                                    "grantRolesToUser": ~user,
