Skip to content

Commit

Permalink
remove true from dynamic property definition, use force-cast back for…
Browse files Browse the repository at this point in the history
… config type
  • Loading branch information
pgayvallet committed Mar 10, 2020
1 parent 41564ea commit 347c6f3
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export interface AuthToolkit
| --- | --- | --- |
| [authenticated](./kibana-plugin-server.authtoolkit.authenticated.md) | <code>(data?: AuthResultParams) =&gt; AuthResult</code> | Authentication is successful with given credentials, allow request to pass through |
| [notHandled](./kibana-plugin-server.authtoolkit.nothandled.md) | <code>() =&gt; AuthResult</code> | User has no credentials. Allows user to access a resource when authRequired: 'optional' Rejects a request when authRequired: true |
| [redirected](./kibana-plugin-server.authtoolkit.redirected.md) | <code>(headers: {</code><br/><code> location: string;</code><br/><code> } &amp; ResponseHeaders) =&gt; AuthResult</code> | Redirect user to IdP when authRequired: true Allows user to access a resource without redirection when authRequired: 'optional' |
| [redirected](./kibana-plugin-server.authtoolkit.redirected.md) | <code>(headers: {</code><br/><code> location: string;</code><br/><code> } &amp; ResponseHeaders) =&gt; AuthResult</code> | Redirects user to another location to complete authentication when authRequired: true Allows user to access a resource without redirection when authRequired: 'optional' |

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## AuthToolkit.redirected property

Redirect user to IdP when authRequired: true Allows user to access a resource without redirection when authRequired: 'optional'
Redirects user to another location to complete authentication when authRequired: true Allows user to access a resource without redirection when authRequired: 'optional'

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

## SavedObjectsTypeMappingDefinition.dynamic property

The dynamic property of the mapping. either `true`<!-- -->, `false` or 'strict'. Defaults to `false`
The dynamic property of the mapping. either `false` or 'strict'. Defaults to `false`

<b>Signature:</b>

```typescript
dynamic?: boolean | 'strict';
dynamic?: false | 'strict';
```
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ const typeDefinition: SavedObjectsTypeMappingDefinition = {

| Property | Type | Description |
| --- | --- | --- |
| [dynamic](./kibana-plugin-server.savedobjectstypemappingdefinition.dynamic.md) | <code>boolean &#124; 'strict'</code> | The dynamic property of the mapping. either <code>true</code>, <code>false</code> or 'strict'. Defaults to <code>false</code> |
| [dynamic](./kibana-plugin-server.savedobjectstypemappingdefinition.dynamic.md) | <code>false &#124; 'strict'</code> | The dynamic property of the mapping. either <code>false</code> or 'strict'. Defaults to <code>false</code> |
| [properties](./kibana-plugin-server.savedobjectstypemappingdefinition.properties.md) | <code>SavedObjectsMappingProperties</code> | The underlying properties of the type mapping |

4 changes: 2 additions & 2 deletions src/core/server/saved_objects/mappings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
* @public
*/
export interface SavedObjectsTypeMappingDefinition {
/** The dynamic property of the mapping. either `true`, `false` or 'strict'. Defaults to `false` */
dynamic?: boolean | 'strict';
/** The dynamic property of the mapping. either `false` or 'strict'. Defaults to `false` */
dynamic?: false | 'strict';
/** The underlying properties of the type mapping */
properties: SavedObjectsMappingProperties;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2173,7 +2173,7 @@ export interface SavedObjectsTypeManagementDefinition {

// @public
export interface SavedObjectsTypeMappingDefinition {
dynamic?: boolean | 'strict';
dynamic?: false | 'strict';
properties: SavedObjectsMappingProperties;
}

Expand Down
5 changes: 4 additions & 1 deletion src/core/server/ui_settings/saved_objects/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ export const uiSettingsType: SavedObjectsType = {
hidden: false,
namespaceAgnostic: false,
mappings: {
dynamic: true,
// we don't want to allow `true` in the public `SavedObjectsTypeMappingDefinition` type, however
// this is needed for the config that is kinda a special type. To avoid adding additional internal types
// just for this, we hardcast to any here.
dynamic: true as any,
properties: {
buildNum: {
type: 'keyword',
Expand Down

0 comments on commit 347c6f3

Please sign in to comment.