3. Security and Validation

mongoDBApiKeyStore

Version

Uses a MongoDB collection as a store for API keys and their scopes. Each document in the collection must use the API key as its _id} and may define an array field scopes listing the allowed scopes.

Example MongoDB document:


 {
   "_id": "123456",
   "scopes": ["read", "write"]
 }
 
apiKey:
stores:
- mongoDBApiKeyStore:
connection: mongodb://localhost:27017
database: security
collection: apikeys
apiKey:
   stores:
     - mongoDBApiKeyStore:
         connection: mongodb://localhost:27017
         database: security
         collection: apikeys

Syntax

mongoDBApiKeyStore:
collection: <string>
connection: <string>
database: <string>
mongoDBApiKeyStore:
  collection: <string>
  connection: <string>
  database: <string>

Attributes

NameRequiredDefaultDescriptionExamples
collectionfalse-The collection name within the database containing the API key documents.apikeys
connectionfalse-MongoDB connection string.mongodb://localhost:27017
databasefalse-The database name where API keys are stored.security

Can be used in