acebase-server 1.19.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +49 -49
- package/.github/workflows/publish.yml +125 -0
- package/Dockerfile +26 -26
- package/LICENSE +21 -21
- package/bin/acebase-server.js +8 -8
- package/create-package-files.sh +25 -0
- package/dist/cjs/routes/data-exists.js +2 -2
- package/dist/cjs/routes/data-export.js +2 -2
- package/dist/cjs/routes/data-get.js +2 -2
- package/dist/cjs/routes/data-reflect.js +2 -2
- package/dist/cjs/routes/docs.js +1 -1
- package/dist/cjs/routes/meta-info.js +1 -1
- package/dist/esm/routes/data-exists.js +1 -2
- package/dist/esm/routes/data-export.js +1 -2
- package/dist/esm/routes/data-get.js +1 -1
- package/dist/esm/routes/data-reflect.js +1 -2
- package/dist/esm/routes/docs.js +1 -1
- package/dist/esm/routes/meta-info.js +1 -1
- package/package.json +4 -5
- package/release_notes.md +4 -0
- package/src/routes/auth-change-password.yaml +73 -73
- package/src/routes/auth-delete.yaml +77 -77
- package/src/routes/auth-forgot-password.yaml +49 -49
- package/src/routes/auth-reset-password.yaml +53 -53
- package/src/routes/auth-signin.yaml +129 -129
- package/src/routes/auth-signout.yaml +46 -46
- package/src/routes/auth-signup.yaml +135 -135
- package/src/routes/auth-state.yaml +28 -28
- package/src/routes/auth-update.yaml +151 -151
- package/src/routes/auth-verify-email.yaml +52 -52
- package/src/routes/data-exists.yaml +44 -44
- package/src/routes/data-export.yaml +63 -63
- package/src/routes/data-import.yaml +74 -74
- package/src/routes/data-index-create.yaml +105 -105
- package/src/routes/data-index-delete.yaml +51 -51
- package/src/routes/data-index-list.yaml +84 -84
- package/src/routes/data-query.yaml +165 -165
- package/src/routes/data-reflect.yaml +124 -124
- package/src/routes/data-schema-get.yaml +53 -53
- package/src/routes/data-schema-set.yaml +64 -64
- package/src/routes/data-schema-test.yaml +66 -66
- package/src/routes/data-schemas-list.yaml +41 -41
- package/src/routes/data-set.yaml +77 -77
- package/src/routes/data-sync-changes.yaml +66 -66
- package/src/routes/data-sync-mutations.yaml +66 -66
- package/src/routes/data-transaction-finish.yaml +82 -82
- package/src/routes/data-transaction-start.yaml +58 -58
- package/src/routes/data-update.yaml +77 -77
- package/src/routes/meta-info.yaml +40 -40
- package/src/routes/meta-ping.yaml +22 -22
- package/src/routes/meta-stats.yaml +40 -40
- package/src/routes/oauth2-init.yaml +62 -62
- package/src/routes/oauth2-refresh.yaml +64 -64
- package/src/routes/oauth2-signin.yaml +65 -65
- package/webmanager/acebase-client-browser.min.js +12 -12
- package/webmanager/index.html +271 -271
- package/webmanager/index.js +437 -437
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
/oauth2/{dbname}/init:
|
|
2
|
-
get:
|
|
3
|
-
tags:
|
|
4
|
-
- auth
|
|
5
|
-
- oauth2
|
|
6
|
-
summary: Starts an OAuth2 flow
|
|
7
|
-
description: Starts a 3rd party OAuth2 authentication flow. This allows a user to sign in (and sign up) using an external auth provider such as Facebook, Google etc. The client app has to call this endpoint to get an url to redirect the user to kick off the OAuth2 flow. If the client is already authenticated, the external account will be linked to the existing user. The provider used must have been added to the server configuration with `server.configAuthProvider(provider, config)`. In the Javascript client, this OAuth2 flow can be kicked off with `client.auth.startAuthProviderSignIn(provider, callbackUrl, options)` or (browser only) `client.auth.signInWithRedirect(provider)` which uses the current url as `callbackUrl`.
|
|
8
|
-
parameters:
|
|
9
|
-
- name: dbname
|
|
10
|
-
in: path
|
|
11
|
-
description: name of the database
|
|
12
|
-
required: true
|
|
13
|
-
schema:
|
|
14
|
-
type: string
|
|
15
|
-
example: mydb
|
|
16
|
-
- name: provider
|
|
17
|
-
in: query
|
|
18
|
-
description: External OAuth2 provider name
|
|
19
|
-
required: true
|
|
20
|
-
schema:
|
|
21
|
-
type: string
|
|
22
|
-
example: facebook
|
|
23
|
-
- name: callbackUrl
|
|
24
|
-
in: query
|
|
25
|
-
description: The url to redirect the user to after they successfully authenticated, or canceled. If the signin is successful, this url is called with a `result` query parameter (eg `https://my.website.com/oauth2/callback?result=eufy3f73gfvjbwe314f...`) that can be used by the AceBase client to finish the OAuth2 flow with `client.auth.finishAuthProviderSignIn(result)`, or `client.auth.getRedirectResult()`. If the signin fails, this url will be called with query parameters `provider`, `error`, and optionally an additional `reason` and `description`, eg `https://my.website.com/oauth2/callback?error=canceled&reason=user_canceled&description=The+user+canceled+the+auth+request`
|
|
26
|
-
required: true
|
|
27
|
-
schema:
|
|
28
|
-
type: string
|
|
29
|
-
format: url
|
|
30
|
-
example: https://my.website.com/oauth2/callback
|
|
31
|
-
- name: option_[name]
|
|
32
|
-
in: query
|
|
33
|
-
description: Additional option to pass to the auth provider. For example `force_reauthentication` can be set for Dropbox by setting `option_force_reauthentication` to `true`
|
|
34
|
-
required: false
|
|
35
|
-
schema:
|
|
36
|
-
type: string
|
|
37
|
-
example: true
|
|
38
|
-
- name: option_force_reauthentication
|
|
39
|
-
in: query
|
|
40
|
-
required: false
|
|
41
|
-
description: Example option, triggers Dropbox to force the user to sign in instead of using the currently signed in user
|
|
42
|
-
schema:
|
|
43
|
-
type: string
|
|
44
|
-
example: true
|
|
45
|
-
responses:
|
|
46
|
-
200:
|
|
47
|
-
description: Returns a JSON object containing the redirectUrl to send the end user to
|
|
48
|
-
content:
|
|
49
|
-
'application/json':
|
|
50
|
-
schema:
|
|
51
|
-
type: object
|
|
52
|
-
properties:
|
|
53
|
-
redirectUrl:
|
|
54
|
-
type: string
|
|
55
|
-
example:
|
|
56
|
-
redirectUrl: https://www.facebook.com/v7.0/dialog/oauth?response_type=code&client_id=[configured facebook client id]&scope=[configured scopes]&redirect_uri=[url set by AceBase]&state=[state set by AceBase]}
|
|
57
|
-
500:
|
|
58
|
-
description: If anything goes wrong on the server, it returns the actual error text in plain text
|
|
59
|
-
content:
|
|
60
|
-
'text/plain':
|
|
61
|
-
schema:
|
|
62
|
-
type: string
|
|
1
|
+
/oauth2/{dbname}/init:
|
|
2
|
+
get:
|
|
3
|
+
tags:
|
|
4
|
+
- auth
|
|
5
|
+
- oauth2
|
|
6
|
+
summary: Starts an OAuth2 flow
|
|
7
|
+
description: Starts a 3rd party OAuth2 authentication flow. This allows a user to sign in (and sign up) using an external auth provider such as Facebook, Google etc. The client app has to call this endpoint to get an url to redirect the user to kick off the OAuth2 flow. If the client is already authenticated, the external account will be linked to the existing user. The provider used must have been added to the server configuration with `server.configAuthProvider(provider, config)`. In the Javascript client, this OAuth2 flow can be kicked off with `client.auth.startAuthProviderSignIn(provider, callbackUrl, options)` or (browser only) `client.auth.signInWithRedirect(provider)` which uses the current url as `callbackUrl`.
|
|
8
|
+
parameters:
|
|
9
|
+
- name: dbname
|
|
10
|
+
in: path
|
|
11
|
+
description: name of the database
|
|
12
|
+
required: true
|
|
13
|
+
schema:
|
|
14
|
+
type: string
|
|
15
|
+
example: mydb
|
|
16
|
+
- name: provider
|
|
17
|
+
in: query
|
|
18
|
+
description: External OAuth2 provider name
|
|
19
|
+
required: true
|
|
20
|
+
schema:
|
|
21
|
+
type: string
|
|
22
|
+
example: facebook
|
|
23
|
+
- name: callbackUrl
|
|
24
|
+
in: query
|
|
25
|
+
description: The url to redirect the user to after they successfully authenticated, or canceled. If the signin is successful, this url is called with a `result` query parameter (eg `https://my.website.com/oauth2/callback?result=eufy3f73gfvjbwe314f...`) that can be used by the AceBase client to finish the OAuth2 flow with `client.auth.finishAuthProviderSignIn(result)`, or `client.auth.getRedirectResult()`. If the signin fails, this url will be called with query parameters `provider`, `error`, and optionally an additional `reason` and `description`, eg `https://my.website.com/oauth2/callback?error=canceled&reason=user_canceled&description=The+user+canceled+the+auth+request`
|
|
26
|
+
required: true
|
|
27
|
+
schema:
|
|
28
|
+
type: string
|
|
29
|
+
format: url
|
|
30
|
+
example: https://my.website.com/oauth2/callback
|
|
31
|
+
- name: option_[name]
|
|
32
|
+
in: query
|
|
33
|
+
description: Additional option to pass to the auth provider. For example `force_reauthentication` can be set for Dropbox by setting `option_force_reauthentication` to `true`
|
|
34
|
+
required: false
|
|
35
|
+
schema:
|
|
36
|
+
type: string
|
|
37
|
+
example: true
|
|
38
|
+
- name: option_force_reauthentication
|
|
39
|
+
in: query
|
|
40
|
+
required: false
|
|
41
|
+
description: Example option, triggers Dropbox to force the user to sign in instead of using the currently signed in user
|
|
42
|
+
schema:
|
|
43
|
+
type: string
|
|
44
|
+
example: true
|
|
45
|
+
responses:
|
|
46
|
+
200:
|
|
47
|
+
description: Returns a JSON object containing the redirectUrl to send the end user to
|
|
48
|
+
content:
|
|
49
|
+
'application/json':
|
|
50
|
+
schema:
|
|
51
|
+
type: object
|
|
52
|
+
properties:
|
|
53
|
+
redirectUrl:
|
|
54
|
+
type: string
|
|
55
|
+
example:
|
|
56
|
+
redirectUrl: https://www.facebook.com/v7.0/dialog/oauth?response_type=code&client_id=[configured facebook client id]&scope=[configured scopes]&redirect_uri=[url set by AceBase]&state=[state set by AceBase]}
|
|
57
|
+
500:
|
|
58
|
+
description: If anything goes wrong on the server, it returns the actual error text in plain text
|
|
59
|
+
content:
|
|
60
|
+
'text/plain':
|
|
61
|
+
schema:
|
|
62
|
+
type: string
|
|
63
63
|
example: Some error text
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
/oauth2/{dbname}/refresh:
|
|
2
|
-
get:
|
|
3
|
-
tags:
|
|
4
|
-
- auth
|
|
5
|
-
- oauth2
|
|
6
|
-
summary: Refreshes an OAuth2 access token
|
|
7
|
-
description: Refreshes an OAuth2 provider's access token using the refresh token given by the auth provider at signin.
|
|
8
|
-
parameters:
|
|
9
|
-
- name: dbname
|
|
10
|
-
in: path
|
|
11
|
-
description: name of the database
|
|
12
|
-
required: true
|
|
13
|
-
schema:
|
|
14
|
-
type: string
|
|
15
|
-
example: mydb
|
|
16
|
-
- name: provider
|
|
17
|
-
in: query
|
|
18
|
-
description: External OAuth2 provider name
|
|
19
|
-
required: true
|
|
20
|
-
schema:
|
|
21
|
-
type: string
|
|
22
|
-
example: facebook
|
|
23
|
-
- name: refresh_token
|
|
24
|
-
in: query
|
|
25
|
-
description: A refresh token from the OAuth2 signin result
|
|
26
|
-
required: true
|
|
27
|
-
schema:
|
|
28
|
-
type: string
|
|
29
|
-
example: erfiyh3rfig3fuyb3rjfg3u7refc...
|
|
30
|
-
responses:
|
|
31
|
-
200:
|
|
32
|
-
description: Returns a JSON object containing new access and refresh tokens and expiry information
|
|
33
|
-
content:
|
|
34
|
-
'application/json':
|
|
35
|
-
schema:
|
|
36
|
-
type: object
|
|
37
|
-
properties:
|
|
38
|
-
name:
|
|
39
|
-
type: string
|
|
40
|
-
description: Provider name
|
|
41
|
-
example: facebook
|
|
42
|
-
access_token:
|
|
43
|
-
type: string
|
|
44
|
-
description: New access token
|
|
45
|
-
example: fkw3ygfi74g25foli2n4vo7h2vto72g4...
|
|
46
|
-
refresh_token:
|
|
47
|
-
type: string
|
|
48
|
-
description: New refresh token
|
|
49
|
-
example: 32lo548jnl34tv73h4l5nbb35ithn3jt...
|
|
50
|
-
expires_in:
|
|
51
|
-
type: integer
|
|
52
|
-
description: Amount of seconds these tokens remain valid. A new refresh will have to be done before they expire.
|
|
53
|
-
example: 3600
|
|
54
|
-
example:
|
|
55
|
-
name: facebook
|
|
56
|
-
access_token: fkw3ygfi74g25foli2n4vo7h2vto72g4...
|
|
57
|
-
refresh_token: 32lo548jnl34tv73h4l5nbb35ithn3jt...
|
|
58
|
-
expires_in: 3600
|
|
59
|
-
500:
|
|
60
|
-
description: If anything goes wrong on the server, it returns the actual error text in plain text
|
|
61
|
-
content:
|
|
62
|
-
'text/plain':
|
|
63
|
-
schema:
|
|
64
|
-
type: string
|
|
1
|
+
/oauth2/{dbname}/refresh:
|
|
2
|
+
get:
|
|
3
|
+
tags:
|
|
4
|
+
- auth
|
|
5
|
+
- oauth2
|
|
6
|
+
summary: Refreshes an OAuth2 access token
|
|
7
|
+
description: Refreshes an OAuth2 provider's access token using the refresh token given by the auth provider at signin.
|
|
8
|
+
parameters:
|
|
9
|
+
- name: dbname
|
|
10
|
+
in: path
|
|
11
|
+
description: name of the database
|
|
12
|
+
required: true
|
|
13
|
+
schema:
|
|
14
|
+
type: string
|
|
15
|
+
example: mydb
|
|
16
|
+
- name: provider
|
|
17
|
+
in: query
|
|
18
|
+
description: External OAuth2 provider name
|
|
19
|
+
required: true
|
|
20
|
+
schema:
|
|
21
|
+
type: string
|
|
22
|
+
example: facebook
|
|
23
|
+
- name: refresh_token
|
|
24
|
+
in: query
|
|
25
|
+
description: A refresh token from the OAuth2 signin result
|
|
26
|
+
required: true
|
|
27
|
+
schema:
|
|
28
|
+
type: string
|
|
29
|
+
example: erfiyh3rfig3fuyb3rjfg3u7refc...
|
|
30
|
+
responses:
|
|
31
|
+
200:
|
|
32
|
+
description: Returns a JSON object containing new access and refresh tokens and expiry information
|
|
33
|
+
content:
|
|
34
|
+
'application/json':
|
|
35
|
+
schema:
|
|
36
|
+
type: object
|
|
37
|
+
properties:
|
|
38
|
+
name:
|
|
39
|
+
type: string
|
|
40
|
+
description: Provider name
|
|
41
|
+
example: facebook
|
|
42
|
+
access_token:
|
|
43
|
+
type: string
|
|
44
|
+
description: New access token
|
|
45
|
+
example: fkw3ygfi74g25foli2n4vo7h2vto72g4...
|
|
46
|
+
refresh_token:
|
|
47
|
+
type: string
|
|
48
|
+
description: New refresh token
|
|
49
|
+
example: 32lo548jnl34tv73h4l5nbb35ithn3jt...
|
|
50
|
+
expires_in:
|
|
51
|
+
type: integer
|
|
52
|
+
description: Amount of seconds these tokens remain valid. A new refresh will have to be done before they expire.
|
|
53
|
+
example: 3600
|
|
54
|
+
example:
|
|
55
|
+
name: facebook
|
|
56
|
+
access_token: fkw3ygfi74g25foli2n4vo7h2vto72g4...
|
|
57
|
+
refresh_token: 32lo548jnl34tv73h4l5nbb35ithn3jt...
|
|
58
|
+
expires_in: 3600
|
|
59
|
+
500:
|
|
60
|
+
description: If anything goes wrong on the server, it returns the actual error text in plain text
|
|
61
|
+
content:
|
|
62
|
+
'text/plain':
|
|
63
|
+
schema:
|
|
64
|
+
type: string
|
|
65
65
|
example: Some error text
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
/oauth2/{dbname}/signin:
|
|
2
|
-
get:
|
|
3
|
-
tags:
|
|
4
|
-
- auth
|
|
5
|
-
- oauth2
|
|
6
|
-
summary: Finishes an OAuth2 flow
|
|
7
|
-
description: Finishes a 3rd party OAuth2 authentication flow. This is the url you have to add to your oAuth2 provider's allowed callback urls; the auth provider will redirect the login result to this address so AceBase auth can handle the signin and then redirect the user to the callbackUrl you provided in the oauth2 init endpoint.
|
|
8
|
-
parameters:
|
|
9
|
-
- name: dbname
|
|
10
|
-
in: path
|
|
11
|
-
description: name of the database
|
|
12
|
-
required: true
|
|
13
|
-
schema:
|
|
14
|
-
type: string
|
|
15
|
-
example: mydb
|
|
16
|
-
- name: state
|
|
17
|
-
in: query
|
|
18
|
-
description: info about the initial oauth2 request (generated by AceBase)
|
|
19
|
-
required: true
|
|
20
|
-
schema:
|
|
21
|
-
type: string
|
|
22
|
-
example: sefwerg44tgwefvq3g4rbqewrgbqebwdfbwsergq34t...
|
|
23
|
-
- name: code
|
|
24
|
-
in: query
|
|
25
|
-
required: false
|
|
26
|
-
description: If signin is successful, contains the authorization code AceBase will use to request access and refresh tokens from the OAuth2 provider.
|
|
27
|
-
schema:
|
|
28
|
-
type: string
|
|
29
|
-
example: erfuihqrf7g3rfgh3rifhwre8f73efuh3eifh...
|
|
30
|
-
- name: error
|
|
31
|
-
in: query
|
|
32
|
-
description: If an error occurred, the error code
|
|
33
|
-
required: false
|
|
34
|
-
schema:
|
|
35
|
-
type: string
|
|
36
|
-
example: canceled
|
|
37
|
-
- name: error_reason
|
|
38
|
-
in: query
|
|
39
|
-
description: If an error occurred, the error reason
|
|
40
|
-
required: false
|
|
41
|
-
schema:
|
|
42
|
-
type: string
|
|
43
|
-
example: user_canceled
|
|
44
|
-
- name: error_description
|
|
45
|
-
in: query
|
|
46
|
-
description: If an error occurred, the error description
|
|
47
|
-
required: false
|
|
48
|
-
schema:
|
|
49
|
-
type: string
|
|
50
|
-
example: The user canceled the auth request
|
|
51
|
-
responses:
|
|
52
|
-
200:
|
|
53
|
-
description: Redirects the user to the callbackUrl you provided in the init endpoint
|
|
54
|
-
headers:
|
|
55
|
-
Location:
|
|
56
|
-
schema:
|
|
57
|
-
type: string
|
|
58
|
-
format: url
|
|
59
|
-
example: https://my.website.com/oauth2/callback?result=er32f32g2erv2erv23g315g..
|
|
60
|
-
500:
|
|
61
|
-
description: If anything goes wrong on the server, it returns the actual error text in plain text
|
|
62
|
-
content:
|
|
63
|
-
'text/plain':
|
|
64
|
-
schema:
|
|
65
|
-
type: string
|
|
1
|
+
/oauth2/{dbname}/signin:
|
|
2
|
+
get:
|
|
3
|
+
tags:
|
|
4
|
+
- auth
|
|
5
|
+
- oauth2
|
|
6
|
+
summary: Finishes an OAuth2 flow
|
|
7
|
+
description: Finishes a 3rd party OAuth2 authentication flow. This is the url you have to add to your oAuth2 provider's allowed callback urls; the auth provider will redirect the login result to this address so AceBase auth can handle the signin and then redirect the user to the callbackUrl you provided in the oauth2 init endpoint.
|
|
8
|
+
parameters:
|
|
9
|
+
- name: dbname
|
|
10
|
+
in: path
|
|
11
|
+
description: name of the database
|
|
12
|
+
required: true
|
|
13
|
+
schema:
|
|
14
|
+
type: string
|
|
15
|
+
example: mydb
|
|
16
|
+
- name: state
|
|
17
|
+
in: query
|
|
18
|
+
description: info about the initial oauth2 request (generated by AceBase)
|
|
19
|
+
required: true
|
|
20
|
+
schema:
|
|
21
|
+
type: string
|
|
22
|
+
example: sefwerg44tgwefvq3g4rbqewrgbqebwdfbwsergq34t...
|
|
23
|
+
- name: code
|
|
24
|
+
in: query
|
|
25
|
+
required: false
|
|
26
|
+
description: If signin is successful, contains the authorization code AceBase will use to request access and refresh tokens from the OAuth2 provider.
|
|
27
|
+
schema:
|
|
28
|
+
type: string
|
|
29
|
+
example: erfuihqrf7g3rfgh3rifhwre8f73efuh3eifh...
|
|
30
|
+
- name: error
|
|
31
|
+
in: query
|
|
32
|
+
description: If an error occurred, the error code
|
|
33
|
+
required: false
|
|
34
|
+
schema:
|
|
35
|
+
type: string
|
|
36
|
+
example: canceled
|
|
37
|
+
- name: error_reason
|
|
38
|
+
in: query
|
|
39
|
+
description: If an error occurred, the error reason
|
|
40
|
+
required: false
|
|
41
|
+
schema:
|
|
42
|
+
type: string
|
|
43
|
+
example: user_canceled
|
|
44
|
+
- name: error_description
|
|
45
|
+
in: query
|
|
46
|
+
description: If an error occurred, the error description
|
|
47
|
+
required: false
|
|
48
|
+
schema:
|
|
49
|
+
type: string
|
|
50
|
+
example: The user canceled the auth request
|
|
51
|
+
responses:
|
|
52
|
+
200:
|
|
53
|
+
description: Redirects the user to the callbackUrl you provided in the init endpoint
|
|
54
|
+
headers:
|
|
55
|
+
Location:
|
|
56
|
+
schema:
|
|
57
|
+
type: string
|
|
58
|
+
format: url
|
|
59
|
+
example: https://my.website.com/oauth2/callback?result=er32f32g2erv2erv23g315g..
|
|
60
|
+
500:
|
|
61
|
+
description: If anything goes wrong on the server, it returns the actual error text in plain text
|
|
62
|
+
content:
|
|
63
|
+
'text/plain':
|
|
64
|
+
schema:
|
|
65
|
+
type: string
|
|
66
66
|
example: Some error text
|