Skip to content

Commit

Permalink
Deployment from App Services
Browse files Browse the repository at this point in the history
  • Loading branch information
mongodb-atlas-app-services[bot] authored Sep 14, 2024
1 parent 295bbc8 commit d7f8f2c
Show file tree
Hide file tree
Showing 9 changed files with 862 additions and 5 deletions.
2 changes: 1 addition & 1 deletion atolog/app/.mdb/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"app_id": "6599942eaf2bde80bede3f0a",
"group_id": "656405b98ff1580b1462f081",
"client_app_id": "atolog-pcxrm",
"last_pulled": 1714747209
"last_pulled": 0
}
4 changes: 2 additions & 2 deletions atolog/app/auth/custom_user_data.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"enabled": true,
"mongo_service_name": "App-Services",
"mongo_service_name": "mongodb-atlas",
"database_name": "db",
"collection_name": "Database",
"user_id_field": "65f96701565e4a9f37587e07",
"on_user_creation_function_name": "resetFunc"
"on_user_creation_function_name": "Endpoint"
}
8 changes: 8 additions & 0 deletions atolog/app/auth/providers.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
"type": "api-key",
"disabled": true
},
"custom-function": {
"name": "custom-function",
"type": "custom-function",
"disabled": false,
"config": {
"authFunctionName": "authFunc"
}
},
"local-userpass": {
"name": "local-userpass",
"type": "local-userpass",
Expand Down
17 changes: 17 additions & 0 deletions atolog/app/functions/authFunc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

/*
This function will be run when a user logs in with this provider.
The return object must contain a string id, this string id will be used to login with an existing
or create a new user. This is NOT the App Services user id, but it is the id used to identify which user has
been created or logged in with.
If an error is thrown within the function the login will fail.
The default function provided below will always result in failure.
*/

exports = (loginPayload) => {
return;
};
8 changes: 8 additions & 0 deletions atolog/app/functions/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,13 @@
{
"name": "resetFunc",
"private": true
},
{
"name": "onUserCreation",
"private": false
},
{
"name": "authFunc",
"private": true
}
]
19 changes: 19 additions & 0 deletions atolog/app/functions/onUserCreation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
This function will run after a user is created and is called with an object representing that user.
This function runs as a System user and has full access to Services, Functions, and MongoDB Data.
Example below:
exports = (user) => {
// use collection that Custom User Data is configured on
const collection = context.services.get("<SERVICE_NAME>").db("<DB_NAME>").collection("<COLL_NAME>");
// insert custom data into collection, using the user id field that Custom User Data is configured on
const doc = collection.insertOne({ <USER_ID_FIELD>: user.id, name: user.data.name });
};
*/

exports = (user) => {
return;
};
6 changes: 4 additions & 2 deletions atolog/app/sync/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
"state": "enabled",
"development_mode_enabled": false,
"service_name": "mongodb-atlas",
"database_name": "todo",
"database_name": "sample_mflix",
"client_max_offline_days": 30,
"is_recovery_mode_disabled": false,
"queryable_fields_names": [
"owner_id"
"owner_id",
"isComplete",
"summary"
]
}
12 changes: 12 additions & 0 deletions atolog/app/values/Environment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Environment",
"value": {
"app_id": "atolog-pcxrm",
"config_version": 20210101,
"name": "ATOLOG",
"provider_region": "aws-us-east-1",
"deployment_model": "GLOBAL",
"environment": "production"
},
"from_secret": false
}
791 changes: 791 additions & 0 deletions atolog/app/values/Vector_Search_Test.json

Large diffs are not rendered by default.

0 comments on commit d7f8f2c

Please sign in to comment.