You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/components/schemas.yaml
+71-46Lines changed: 71 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -390,25 +390,42 @@ User-session-information:
390
390
type: object
391
391
properties:
392
392
authentication_handlers:
393
-
description: The ways authentication can be established to authenticate as the user.
393
+
description: The ways authentication can be established to authenticate as a user. Used for CouchDB compatibility. Always contains "default" and "cookie".
394
394
type: array
395
-
items:
396
-
type: string
395
+
enum:
396
+
- ["default", "cookie"]
397
+
default: ["default", "cookie"]
397
398
ok:
399
+
description: Used for CouchDB compatibility. Always true.
398
400
type: boolean
401
+
enum:
402
+
- true
399
403
userCtx:
400
404
type: object
401
405
properties:
402
406
channels:
403
-
description: |
404
-
A map of the channels the user has access to and the sequence number each channel was created at.
405
-
406
-
The key is the channel name and the value is the sequence number.
407
+
description: A map of the channels in the default collection that the user is in along with the sequence number the user was granted access. This does not include inherited channels through roles.
407
408
type: object
409
+
additionalProperties:
410
+
x-additionalPropertiesName: channelName
411
+
type: number
412
+
minimum: 1
413
+
description: The sequence number the user was granted access.
414
+
title: sequence number
415
+
example:
416
+
"!": 1
417
+
"channelA": 2
408
418
name:
409
419
description: The name of the user.
410
420
type: string
411
-
nullable: true
421
+
minLength: 1
422
+
required:
423
+
- channels
424
+
- name
425
+
required:
426
+
- authentication_handlers
427
+
- ok
428
+
- userCtx
412
429
title: User Session Information
413
430
OIDC-callback:
414
431
type: object
@@ -1644,24 +1661,9 @@ Database:
1644
1661
1645
1662
This also sets the default value of query param `request_plus` for [GET /{keyspace}/_changes](#operation/get_keyspace-_changes) or `request_plus` for [POST /{keyspace}/_changes](#operation/post_keyspace-_changes).
1646
1663
cors:
1647
-
description: CORS configuration for this database; if present, overrides server's config.
1648
-
type: object
1649
-
properties:
1650
-
origin:
1651
-
description: 'List of allowed origins, use [''*''] to allow access from everywhere'
1652
-
type: array
1653
-
items:
1654
-
type: string
1655
-
login_origin:
1656
-
description: List of allowed login origins
1657
-
type: array
1658
-
items:
1659
-
type: string
1660
-
headers:
1661
-
description: List of allowed headers
1662
-
type: array
1663
-
items:
1664
-
type: string
1664
+
allOf:
1665
+
- $ref: "#/CORS"
1666
+
- type: object
1665
1667
logging:
1666
1668
description: Per-database logging configuration.
1667
1669
type: object
@@ -2145,26 +2147,10 @@ Startup-config:
2145
2147
description: The TLS key file to use for the REST APIs
2146
2148
type: string
2147
2149
cors:
2148
-
type: object
2149
-
properties:
2150
-
origin:
2151
-
description: 'List of allowed origins, use [''*''] to allow access from everywhere'
2152
-
type: array
2153
-
items:
2154
-
type: string
2155
-
login_origin:
2156
-
description: List of allowed login origins
2157
-
type: array
2158
-
items:
2159
-
type: string
2160
-
headers:
2161
-
description: List of allowed headers
2162
-
type: array
2163
-
items:
2164
-
type: string
2165
-
max_age:
2166
-
description: Maximum age of the CORS Options request
2167
-
type: integer
2150
+
allOf:
2151
+
- type: object
2152
+
description: CORS configuration for all databases
2153
+
- $ref: "#/CORS"
2168
2154
readOnly: true
2169
2155
logging:
2170
2156
description: The configuration settings for modifying Sync Gateway logging.
@@ -2977,3 +2963,42 @@ DatabaseState:
2977
2963
Starting: The database is in the process of going online.
2978
2964
Stopping: The database is no longer accepting connections and is being taken offline or deleted.
2979
2965
Resyncing: The database is offline and performing a resync operation.
2966
+
CORS:
2967
+
type: object
2968
+
properties:
2969
+
headers:
2970
+
description: |-
2971
+
List of allowed headers. These headers will be added the `Access-Control-Allow-Headers` response to a valid CORS request.
2972
+
2973
+
A recommended minimum set of values should be `["Accept-Encoding", "Authorization", "Content-Type", "If-Match"]`.
2974
+
type: array
2975
+
items:
2976
+
type: string
2977
+
example:
2978
+
- Accept-Encoding
2979
+
- Authorization
2980
+
- Content-Type
2981
+
- If-Match
2982
+
login_origin:
2983
+
description: |-
2984
+
List of allowed origins to apply to public `/{db}/_session` API.
2985
+
2986
+
To use cors on `/{db}/_session`, the domain must be present in both `login_origin` and `origin`.
2987
+
2988
+
If configured, `Authorization` must be included in headers.
2989
+
type: array
2990
+
items:
2991
+
type: string
2992
+
example: ["https://example.com"]
2993
+
max_age:
2994
+
description: Value for `Access-Control-Maximum-Age`. Uses 0 by default.
2995
+
type: integer
2996
+
default: 0
2997
+
origin:
2998
+
description: |-
2999
+
List of allowed origins for the public API. The request `Origin` header is checked against these values. If successful the `Origin` header is returned in the HTTP response header as `Access-Control-Allow-Origin`.
Copy file name to clipboardExpand all lines: docs/api/paths/admin/db-_facebook.yaml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ post:
12
12
description: |-
13
13
Creates a new session based on a Facebook user. On a successful session creation, a session cookie is stored to keep the user authenticated for future API calls.
14
14
15
-
If CORS is enabled, the origin must match an allowed login origin otherwise an error will be returned.
15
+
If `Origin` header is passed to this endpoint, the `Origin` header must match both the `cors.login_origin` and `cors.origin` configuration options.
Copy file name to clipboardExpand all lines: docs/api/paths/admin/db-_google.yaml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ post:
12
12
description: |-
13
13
Creates a new session based on a Google user. On a successful session creation, a session cookie is stored to keep the user authenticated for future API calls.
14
14
15
-
If CORS is enabled, the origin must match an allowed login origin otherwise an error will be returned.
15
+
If `Origin` header is passed to this endpoint, the `Origin` header must match both the `cors.login_origin` and `cors.origin` configuration options.
Copy file name to clipboardExpand all lines: docs/api/paths/public/db-_facebook.yaml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ post:
12
12
description: |-
13
13
Creates a new session based on a Facebook user. On a successful session creation, a session cookie is stored to keep the user authenticated for future API calls.
14
14
15
-
If CORS is enabled, the origin must match an allowed login origin otherwise an error will be returned.
15
+
If `Origin` header is passed to this endpoint, the `Origin` header must match both the `cors.login_origin` and `cors.origin` configuration options.
Copy file name to clipboardExpand all lines: docs/api/paths/public/db-_google.yaml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ post:
12
12
description: |-
13
13
Creates a new session based on a Google user. On a successful session creation, a session cookie is stored to keep the user authenticated for future API calls.
14
14
15
-
If CORS is enabled, the origin must match an allowed login origin otherwise an error will be returned.
15
+
If `Origin` header is passed to this endpoint, the `Origin` header must match both the `cors.login_origin` and `cors.origin` configuration options.
0 commit comments