Skip to content

Commit

Permalink
remove try auth mode (#94287)
Browse files Browse the repository at this point in the history
* remove `try` auth mode

* update generated doc

* update generated doc

* adapt integration test
  • Loading branch information
pgayvallet authored Mar 10, 2021
1 parent 6044f8a commit 7d2c4d4
Show file tree
Hide file tree
Showing 18 changed files with 219 additions and 222 deletions.
104 changes: 52 additions & 52 deletions api_docs/actions.json

Large diffs are not rendered by default.

80 changes: 40 additions & 40 deletions api_docs/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -6622,14 +6622,6 @@
"label": "asScoped",
"signature": [
"(request?: ",
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.FakeRequest",
"text": "FakeRequest"
},
" | ",
{
"pluginId": "core",
"scope": "server",
Expand All @@ -6645,6 +6637,14 @@
"section": "def-server.LegacyRequest",
"text": "LegacyRequest"
},
" | ",
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.FakeRequest",
"text": "FakeRequest"
},
" | undefined) => Pick<",
{
"pluginId": "core",
Expand All @@ -6664,14 +6664,6 @@
"label": "request",
"isRequired": false,
"signature": [
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.FakeRequest",
"text": "FakeRequest"
},
" | ",
{
"pluginId": "core",
"scope": "server",
Expand All @@ -6687,6 +6679,14 @@
"section": "def-server.LegacyRequest",
"text": "LegacyRequest"
},
" | ",
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.FakeRequest",
"text": "FakeRequest"
},
" | undefined"
],
"description": [
Expand Down Expand Up @@ -16174,14 +16174,6 @@
},
"signature": [
"{ callAsInternalUser: LegacyAPICaller; asScoped: (request?: ",
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.FakeRequest",
"text": "FakeRequest"
},
" | ",
{
"pluginId": "core",
"scope": "server",
Expand All @@ -16197,6 +16189,14 @@
"section": "def-server.LegacyRequest",
"text": "LegacyRequest"
},
" | ",
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.FakeRequest",
"text": "FakeRequest"
},
" | undefined) => Pick<LegacyScopedClusterClient, \"callAsCurrentUser\" | \"callAsInternalUser\">; }"
],
"initialIsOpen": false
Expand All @@ -16218,14 +16218,6 @@
},
"signature": [
"{ close: () => void; callAsInternalUser: LegacyAPICaller; asScoped: (request?: ",
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.FakeRequest",
"text": "FakeRequest"
},
" | ",
{
"pluginId": "core",
"scope": "server",
Expand All @@ -16241,6 +16233,14 @@
"section": "def-server.LegacyRequest",
"text": "LegacyRequest"
},
" | ",
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.FakeRequest",
"text": "FakeRequest"
},
" | undefined) => Pick<LegacyScopedClusterClient, \"callAsCurrentUser\" | \"callAsInternalUser\">; }"
],
"initialIsOpen": false
Expand Down Expand Up @@ -16533,14 +16533,6 @@
"lineNumber": 192
},
"signature": [
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.FakeRequest",
"text": "FakeRequest"
},
" | ",
{
"pluginId": "core",
"scope": "server",
Expand All @@ -16555,6 +16547,14 @@
"docId": "kibCoreHttpPluginApi",
"section": "def-server.LegacyRequest",
"text": "LegacyRequest"
},
" | ",
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.FakeRequest",
"text": "FakeRequest"
}
],
"initialIsOpen": false
Expand Down
24 changes: 12 additions & 12 deletions api_docs/core_http.json
Original file line number Diff line number Diff line change
Expand Up @@ -2887,7 +2887,7 @@
"type": "Function",
"label": "notHandled",
"description": [
"\nUser has no credentials.\nAllows user to access a resource when authRequired is 'optional' or 'try'\nRejects a request when authRequired: true"
"\nUser has no credentials.\nAllows user to access a resource when authRequired is 'optional'\nRejects a request when authRequired: true"
],
"source": {
"path": "src/core/server/http/lifecycle/auth.ts",
Expand Down Expand Up @@ -4648,7 +4648,7 @@
],
"source": {
"path": "src/core/server/http/router/route.ts",
"lineNumber": 173
"lineNumber": 171
}
},
{
Expand All @@ -4661,7 +4661,7 @@
],
"source": {
"path": "src/core/server/http/router/route.ts",
"lineNumber": 231
"lineNumber": 229
},
"signature": [
"false | ",
Expand All @@ -4685,7 +4685,7 @@
],
"source": {
"path": "src/core/server/http/router/route.ts",
"lineNumber": 236
"lineNumber": 234
},
"signature": [
{
Expand All @@ -4701,7 +4701,7 @@
],
"source": {
"path": "src/core/server/http/router/route.ts",
"lineNumber": 159
"lineNumber": 157
},
"initialIsOpen": false
},
Expand Down Expand Up @@ -4732,14 +4732,14 @@
"type": "CompoundType",
"label": "authRequired",
"description": [
"\nDefines authentication mode for a route:\n- true. A user has to have valid credentials to access a resource\n- false. A user can access a resource without any credentials.\n- 'optional'. A user can access a resource if has valid credentials or no credentials at all.\n Can be useful when we grant access to a resource but want to identify a user if possible.\n- 'try'. A user can access a resource with valid, invalid or without any credentials.\n Users with valid credentials will be authenticated\n\nDefaults to `true` if an auth mechanism is registered."
"\nDefines authentication mode for a route:\n- true. A user has to have valid credentials to access a resource\n- false. A user can access a resource without any credentials.\n- 'optional'. A user can access a resource, and will be authenticated if provided credentials are valid.\n Can be useful when we grant access to a resource but want to identify a user if possible.\n\nDefaults to `true` if an auth mechanism is registered."
],
"source": {
"path": "src/core/server/http/router/route.ts",
"lineNumber": 118
"lineNumber": 116
},
"signature": [
"boolean | \"optional\" | \"try\" | undefined"
"boolean | \"optional\" | undefined"
]
},
{
Expand All @@ -4752,7 +4752,7 @@
],
"source": {
"path": "src/core/server/http/router/route.ts",
"lineNumber": 127
"lineNumber": 125
},
"signature": [
"(Method extends \"get\" ? never : boolean) | undefined"
Expand All @@ -4768,7 +4768,7 @@
],
"source": {
"path": "src/core/server/http/router/route.ts",
"lineNumber": 132
"lineNumber": 130
},
"signature": [
"readonly string[] | undefined"
Expand All @@ -4784,7 +4784,7 @@
],
"source": {
"path": "src/core/server/http/router/route.ts",
"lineNumber": 137
"lineNumber": 135
},
"signature": [
"(Method extends ",
Expand Down Expand Up @@ -4816,7 +4816,7 @@
],
"source": {
"path": "src/core/server/http/router/route.ts",
"lineNumber": 142
"lineNumber": 140
},
"signature": [
"{ payload?: (Method extends ",
Expand Down
78 changes: 77 additions & 1 deletion api_docs/lists.json
Original file line number Diff line number Diff line change
Expand Up @@ -3706,7 +3706,83 @@
},
"common": {
"classes": [],
"functions": [],
"functions": [
{
"id": "def-common.buildExceptionFilter",
"type": "Function",
"children": [
{
"id": "def-common.buildExceptionFilter.{\n- lists,\n excludeExceptions,\n chunkSize,\n}",
"type": "Object",
"label": "{\n lists,\n excludeExceptions,\n chunkSize,\n}",
"tags": [],
"description": [],
"children": [
{
"tags": [],
"id": "def-common.buildExceptionFilter.{\n- lists,\n excludeExceptions,\n chunkSize,\n}.lists",
"type": "Array",
"label": "lists",
"description": [],
"source": {
"path": "x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts",
"lineNumber": 74
},
"signature": [
"(({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"long\" | \"double\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"short\" | \"binary\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"double_range\" | \"float_range\" | \"half_float\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"long\" | \"double\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"short\" | \"binary\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"double_range\" | \"float_range\" | \"half_float\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; })[]"
]
},
{
"tags": [],
"id": "def-common.buildExceptionFilter.{\n- lists,\n excludeExceptions,\n chunkSize,\n}.excludeExceptions",
"type": "boolean",
"label": "excludeExceptions",
"description": [],
"source": {
"path": "x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts",
"lineNumber": 75
}
},
{
"tags": [],
"id": "def-common.buildExceptionFilter.{\n- lists,\n excludeExceptions,\n chunkSize,\n}.chunkSize",
"type": "number",
"label": "chunkSize",
"description": [],
"source": {
"path": "x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts",
"lineNumber": 76
}
}
],
"source": {
"path": "x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts",
"lineNumber": 73
}
}
],
"signature": [
"({ lists, excludeExceptions, chunkSize, }: { lists: (({ description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"long\" | \"double\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"short\" | \"binary\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"double_range\" | \"float_range\" | \"half_float\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; list_id: string; name: string; type: \"simple\"; } & { comments?: { comment: string; }[] | undefined; item_id?: string | undefined; meta?: object | undefined; namespace_type?: \"single\" | \"agnostic\" | undefined; os_types?: (\"windows\" | \"linux\" | \"macos\")[] | undefined; tags?: string[] | undefined; }) | { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"long\" | \"double\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"short\" | \"binary\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"double_range\" | \"float_range\" | \"half_float\" | \"integer_range\" | \"long_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; })[]; field: string; type: \"nested\"; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; })[]; excludeExceptions: boolean; chunkSize: number; }) => ",
{
"pluginId": "data",
"scope": "common",
"docId": "kibDataPluginApi",
"section": "def-common.Filter",
"text": "Filter"
},
" | undefined"
],
"description": [],
"label": "buildExceptionFilter",
"source": {
"path": "x-pack/plugins/lists/common/exceptions/build_exceptions_filter.ts",
"lineNumber": 69
},
"tags": [],
"returnComment": [],
"initialIsOpen": false
}
],
"interfaces": [],
"enums": [
{
Expand Down
3 changes: 3 additions & 0 deletions api_docs/lists.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ import listsObj from './lists.json';
### Objects
<DocDefinitionList data={listsObj.common.objects}/>

### Functions
<DocDefinitionList data={listsObj.common.functions}/>

### Enums
<DocDefinitionList data={listsObj.common.enums}/>

Expand Down
20 changes: 6 additions & 14 deletions api_docs/vis_type_timeseries.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"description": [],
"source": {
"path": "src/plugins/vis_type_timeseries/server/plugin.ts",
"lineNumber": 48
"lineNumber": 53
},
"signature": [
"(requestContext: ",
Expand All @@ -45,19 +45,11 @@
{
"pluginId": "core",
"scope": "server",
"docId": "kibCorePluginApi",
"section": "def-server.FakeRequest",
"text": "FakeRequest"
"docId": "kibCoreHttpPluginApi",
"section": "def-server.KibanaRequest",
"text": "KibanaRequest"
},
", options: ",
{
"pluginId": "visTypeTimeseries",
"scope": "server",
"docId": "kibVisTypeTimeseriesPluginApi",
"section": "def-server.GetVisDataOptions",
"text": "GetVisDataOptions"
},
") => Promise<",
"<unknown, unknown, unknown, any>, options: any) => Promise<",
{
"pluginId": "visTypeTimeseries",
"scope": "common",
Expand All @@ -71,7 +63,7 @@
],
"source": {
"path": "src/plugins/vis_type_timeseries/server/plugin.ts",
"lineNumber": 47
"lineNumber": 52
},
"lifecycle": "setup",
"initialIsOpen": true
Expand Down
Loading

0 comments on commit 7d2c4d4

Please sign in to comment.