-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 80-s-asset-entity-manager
- Loading branch information
Showing
75 changed files
with
786 additions
and
1,112 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @kbn/security-form-components | ||
|
||
Contains form components used within the security plugin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export * from './src/components'; |
16 changes: 16 additions & 0 deletions
16
x-pack/packages/security/api_key_management/jest.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
module.exports = { | ||
coverageDirectory: | ||
'<rootDir>/target/kibana-coverage/jest/x-pack/packages/security/api_key_management', | ||
coverageReporters: ['text', 'html'], | ||
collectCoverageFrom: ['<rootDir>/x-pack/packages/security/api_key_management/**/*.{ts,tsx}'], | ||
preset: '@kbn/test', | ||
rootDir: '../../../..', | ||
roots: ['<rootDir>/x-pack/packages/security/api_key_management'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "shared-browser", | ||
"id": "@kbn/security-api-key-management", | ||
"owner": "@elastic/kibana-security" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "@kbn/security-api-key-management", | ||
"private": true, | ||
"version": "1.0.0", | ||
"license": "Elastic License 2.0" | ||
} |
66 changes: 66 additions & 0 deletions
66
x-pack/packages/security/api_key_management/src/components/api_key_badge.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { EuiToolTip, EuiBadge } from '@elastic/eui'; | ||
import React, { FunctionComponent } from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
|
||
export interface ApiKeyBadgeProps { | ||
type: 'rest' | 'cross_cluster' | 'managed'; | ||
} | ||
|
||
export const ApiKeyBadge: FunctionComponent<ApiKeyBadgeProps> = ({ type }) => { | ||
return type === 'cross_cluster' ? ( | ||
<EuiToolTip | ||
content={ | ||
<FormattedMessage | ||
id="xpack.security.accountManagement.apiKeyBadge.crossClusterDescription" | ||
defaultMessage="Allows remote clusters to connect to your local cluster." | ||
/> | ||
} | ||
> | ||
<EuiBadge color="hollow" iconType="cluster"> | ||
<FormattedMessage | ||
id="xpack.security.accountManagement.apiKeyBadge.crossClusterLabel" | ||
defaultMessage="Cross-Cluster" | ||
/> | ||
</EuiBadge> | ||
</EuiToolTip> | ||
) : type === 'managed' ? ( | ||
<EuiToolTip | ||
content={ | ||
<FormattedMessage | ||
id="xpack.security.accountManagement.apiKeyBadge.managedDescription" | ||
defaultMessage="Created and managed by Kibana to correctly run background tasks." | ||
/> | ||
} | ||
> | ||
<EuiBadge color="hollow" iconType="gear"> | ||
<FormattedMessage | ||
id="xpack.security.accountManagement.apiKeyBadge.managedTitle" | ||
defaultMessage="Managed" | ||
/> | ||
</EuiBadge> | ||
</EuiToolTip> | ||
) : ( | ||
<EuiToolTip | ||
content={ | ||
<FormattedMessage | ||
id="xpack.security.accountManagement.apiKeyBadge.restDescription" | ||
defaultMessage="Allows external services to access the Elastic Stack on behalf of a user." | ||
/> | ||
} | ||
> | ||
<EuiBadge color="hollow" iconType="user"> | ||
<FormattedMessage | ||
id="xpack.security.accountManagement.apiKeyBadge.restTitle" | ||
defaultMessage="Personal" | ||
/> | ||
</EuiBadge> | ||
</EuiToolTip> | ||
); | ||
}; |
85 changes: 85 additions & 0 deletions
85
x-pack/packages/security/api_key_management/src/components/api_key_created_callout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { EuiCallOut } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import React, { FunctionComponent } from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { CreateAPIKeyResult } from './api_keys_api_client'; | ||
import { SelectableTokenField } from './token_field'; | ||
|
||
export interface ApiKeyCreatedCalloutProps { | ||
createdApiKey: CreateAPIKeyResult; | ||
} | ||
|
||
export const ApiKeyCreatedCallout: FunctionComponent<ApiKeyCreatedCalloutProps> = ({ | ||
createdApiKey, | ||
}) => { | ||
return ( | ||
<EuiCallOut | ||
color="success" | ||
iconType="check" | ||
title={i18n.translate('xpack.security.management.apiKeys.createSuccessMessage', { | ||
defaultMessage: "Created API key ''{name}''", | ||
values: { name: createdApiKey.name }, | ||
})} | ||
> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.security.management.apiKeys.successDescription" | ||
defaultMessage="Copy this key now. You will not be able to view it again." | ||
/> | ||
</p> | ||
<ApiKeySelectableTokenField createdApiKey={createdApiKey} /> | ||
</EuiCallOut> | ||
); | ||
}; | ||
|
||
export const ApiKeySelectableTokenField: FunctionComponent<ApiKeyCreatedCalloutProps> = ({ | ||
createdApiKey, | ||
}) => { | ||
const concatenated = `${createdApiKey.id}:${createdApiKey.api_key}`; | ||
return ( | ||
<SelectableTokenField | ||
options={[ | ||
{ | ||
key: 'encoded', | ||
value: createdApiKey.encoded, | ||
icon: 'empty', | ||
label: i18n.translate('xpack.security.management.apiKeys.encodedLabel', { | ||
defaultMessage: 'Encoded', | ||
}), | ||
description: i18n.translate('xpack.security.management.apiKeys.encodedDescription', { | ||
defaultMessage: 'Format used to make requests to Elasticsearch REST API.', | ||
}), | ||
}, | ||
{ | ||
key: 'beats', | ||
value: concatenated, | ||
icon: 'logoBeats', | ||
label: i18n.translate('xpack.security.management.apiKeys.beatsLabel', { | ||
defaultMessage: 'Beats', | ||
}), | ||
description: i18n.translate('xpack.security.management.apiKeys.beatsDescription', { | ||
defaultMessage: 'Format used to configure Beats.', | ||
}), | ||
}, | ||
{ | ||
key: 'logstash', | ||
value: concatenated, | ||
icon: 'logoLogstash', | ||
label: i18n.translate('xpack.security.management.apiKeys.logstashLabel', { | ||
defaultMessage: 'Logstash', | ||
}), | ||
description: i18n.translate('xpack.security.management.apiKeys.logstashDescription', { | ||
defaultMessage: 'Format used to configure Logstash.', | ||
}), | ||
}, | ||
]} | ||
/> | ||
); | ||
}; |
Oops, something went wrong.