Use documentation link service for security links (#87409)
This commit is contained in:
parent
1a9836b296
commit
78dea4f03f
|
@ -201,10 +201,13 @@ export class DocLinksService {
|
||||||
apiKeyServiceSettings: `${ELASTICSEARCH_DOCS}security-settings.html#api-key-service-settings`,
|
apiKeyServiceSettings: `${ELASTICSEARCH_DOCS}security-settings.html#api-key-service-settings`,
|
||||||
clusterPrivileges: `${ELASTICSEARCH_DOCS}security-privileges.html#privileges-list-cluster`,
|
clusterPrivileges: `${ELASTICSEARCH_DOCS}security-privileges.html#privileges-list-cluster`,
|
||||||
elasticsearchSettings: `${ELASTICSEARCH_DOCS}security-settings.html`,
|
elasticsearchSettings: `${ELASTICSEARCH_DOCS}security-settings.html`,
|
||||||
|
elasticsearchEnableSecurity: `${ELASTICSEARCH_DOCS}get-started-enable-security.html`,
|
||||||
indicesPrivileges: `${ELASTICSEARCH_DOCS}security-privileges.html#privileges-list-indices`,
|
indicesPrivileges: `${ELASTICSEARCH_DOCS}security-privileges.html#privileges-list-indices`,
|
||||||
kibanaTLS: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/configuring-tls.html`,
|
kibanaTLS: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/configuring-tls.html`,
|
||||||
kibanaPrivileges: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-privileges.html`,
|
kibanaPrivileges: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kibana-privileges.html`,
|
||||||
mappingRoles: `${ELASTICSEARCH_DOCS}mapping-roles.html`,
|
mappingRoles: `${ELASTICSEARCH_DOCS}mapping-roles.html`,
|
||||||
|
mappingRolesFieldRules: `${ELASTICSEARCH_DOCS}role-mapping-resources.html#mapping-roles-rule-field`,
|
||||||
|
runAsPrivilege: `${ELASTICSEARCH_DOCS}security-privileges.html#_run_as_privilege`,
|
||||||
},
|
},
|
||||||
watcher: {
|
watcher: {
|
||||||
jiraAction: `${ELASTICSEARCH_DOCS}actions-jira.html`,
|
jiraAction: `${ELASTICSEARCH_DOCS}actions-jira.html`,
|
||||||
|
@ -219,6 +222,7 @@ export class DocLinksService {
|
||||||
createIndex: `${ELASTICSEARCH_DOCS}indices-create-index.html`,
|
createIndex: `${ELASTICSEARCH_DOCS}indices-create-index.html`,
|
||||||
createSnapshotLifecylePolicy: `${ELASTICSEARCH_DOCS}slm-api-put-policy.html`,
|
createSnapshotLifecylePolicy: `${ELASTICSEARCH_DOCS}slm-api-put-policy.html`,
|
||||||
createRoleMapping: `${ELASTICSEARCH_DOCS}security-api-put-role-mapping.html`,
|
createRoleMapping: `${ELASTICSEARCH_DOCS}security-api-put-role-mapping.html`,
|
||||||
|
createRoleMappingTemplates: `${ELASTICSEARCH_DOCS}security-api-put-role-mapping.html#_role_templates`,
|
||||||
createApiKey: `${ELASTICSEARCH_DOCS}security-api-create-api-key.html`,
|
createApiKey: `${ELASTICSEARCH_DOCS}security-api-create-api-key.html`,
|
||||||
createPipeline: `${ELASTICSEARCH_DOCS}put-pipeline-api.html`,
|
createPipeline: `${ELASTICSEARCH_DOCS}put-pipeline-api.html`,
|
||||||
createTransformRequest: `${ELASTICSEARCH_DOCS}put-transform.html#put-transform-request-body`,
|
createTransformRequest: `${ELASTICSEARCH_DOCS}put-transform.html#put-transform-request-body`,
|
||||||
|
|
|
@ -63,10 +63,8 @@ export class LicenseManagementUIPlugin
|
||||||
docLinks,
|
docLinks,
|
||||||
chrome: { docTitle },
|
chrome: { docTitle },
|
||||||
} = coreStart;
|
} = coreStart;
|
||||||
const { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } = docLinks;
|
|
||||||
const esBase = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}`;
|
|
||||||
const appDocLinks = {
|
const appDocLinks = {
|
||||||
security: `${esBase}/security-settings.html`,
|
security: docLinks.links.security.elasticsearchSettings,
|
||||||
};
|
};
|
||||||
|
|
||||||
docTitle.change(PLUGIN.title);
|
docTitle.change(PLUGIN.title);
|
||||||
|
|
|
@ -4,7 +4,8 @@ exports[`APIKeysGridPage renders a callout when API keys are not enabled 1`] = `
|
||||||
<NotEnabled
|
<NotEnabled
|
||||||
docLinks={
|
docLinks={
|
||||||
DocumentationLinksService {
|
DocumentationLinksService {
|
||||||
"esDocBasePath": "https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/",
|
"apiKeySettings": "https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-settings.html#api-key-service-settings",
|
||||||
|
"createApiKey": "https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-api-create-api-key.html",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|
|
@ -43,7 +43,7 @@ describe('apiKeysManagementApp', () => {
|
||||||
expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: '/', text: 'API Keys' }]);
|
expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: '/', text: 'API Keys' }]);
|
||||||
expect(container).toMatchInlineSnapshot(`
|
expect(container).toMatchInlineSnapshot(`
|
||||||
<div>
|
<div>
|
||||||
Page: {"notifications":{"toasts":{}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"apiKeysAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}}}
|
Page: {"notifications":{"toasts":{}},"docLinks":{"apiKeySettings":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-settings.html#api-key-service-settings","createApiKey":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-api-create-api-key.html"},"apiKeysAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}}}
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
|
|
@ -7,17 +7,19 @@
|
||||||
import { DocLinksStart } from 'src/core/public';
|
import { DocLinksStart } from 'src/core/public';
|
||||||
|
|
||||||
export class DocumentationLinksService {
|
export class DocumentationLinksService {
|
||||||
private readonly esDocBasePath: string;
|
private readonly apiKeySettings: string;
|
||||||
|
private readonly createApiKey: string;
|
||||||
|
|
||||||
constructor(docLinks: DocLinksStart) {
|
constructor(docLinks: DocLinksStart) {
|
||||||
this.esDocBasePath = `${docLinks.ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${docLinks.DOC_LINK_VERSION}/`;
|
this.apiKeySettings = `${docLinks.links.security.apiKeyServiceSettings}`;
|
||||||
|
this.createApiKey = `${docLinks.links.apis.createApiKey}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getApiKeyServiceSettingsDocUrl() {
|
public getApiKeyServiceSettingsDocUrl() {
|
||||||
return `${this.esDocBasePath}security-settings.html#api-key-service-settings`;
|
return `${this.apiKeySettings}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getCreateApiKeyDocUrl() {
|
public getCreateApiKeyDocUrl() {
|
||||||
return `${this.esDocBasePath}security-api-create-api-key.html`;
|
return `${this.createApiKey}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,25 +7,31 @@
|
||||||
import { DocLinksStart } from 'src/core/public';
|
import { DocLinksStart } from 'src/core/public';
|
||||||
|
|
||||||
export class DocumentationLinksService {
|
export class DocumentationLinksService {
|
||||||
private readonly esDocBasePath: string;
|
private readonly mappingRoles: string;
|
||||||
|
private readonly createRoleMapping: string;
|
||||||
|
private readonly createRoleMappingTemplates: string;
|
||||||
|
private readonly roleMappingFieldRules: string;
|
||||||
|
|
||||||
constructor(docLinks: DocLinksStart) {
|
constructor(docLinks: DocLinksStart) {
|
||||||
this.esDocBasePath = `${docLinks.ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${docLinks.DOC_LINK_VERSION}/`;
|
this.mappingRoles = `${docLinks.links.security.mappingRoles}`;
|
||||||
|
this.createRoleMapping = `${docLinks.links.apis.createRoleMapping}`;
|
||||||
|
this.createRoleMappingTemplates = `${docLinks.links.apis.createRoleMappingTemplates}`;
|
||||||
|
this.roleMappingFieldRules = `${docLinks.links.security.mappingRolesFieldRules}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getRoleMappingDocUrl() {
|
public getRoleMappingDocUrl() {
|
||||||
return `${this.esDocBasePath}/mapping-roles.html`;
|
return `${this.mappingRoles}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getRoleMappingAPIDocUrl() {
|
public getRoleMappingAPIDocUrl() {
|
||||||
return `${this.esDocBasePath}/security-api-put-role-mapping.html`;
|
return `${this.createRoleMapping}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getRoleMappingTemplateDocUrl() {
|
public getRoleMappingTemplateDocUrl() {
|
||||||
return `${this.esDocBasePath}/security-api-put-role-mapping.html#_role_templates`;
|
return `${this.createRoleMappingTemplates}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getRoleMappingFieldRulesDocUrl() {
|
public getRoleMappingFieldRulesDocUrl() {
|
||||||
return `${this.esDocBasePath}/role-mapping-resources.html#mapping-roles-rule-field`;
|
return `${this.roleMappingFieldRules}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ describe('roleMappingsManagementApp', () => {
|
||||||
expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: `/`, text: 'Role Mappings' }]);
|
expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: `/`, text: 'Role Mappings' }]);
|
||||||
expect(container).toMatchInlineSnapshot(`
|
expect(container).toMatchInlineSnapshot(`
|
||||||
<div>
|
<div>
|
||||||
Role Mappings Page: {"notifications":{"toasts":{}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"roleMappingsAPI":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"history":{"action":"PUSH","length":1,"location":{"pathname":"/","search":"","hash":""}}}
|
Role Mappings Page: {"notifications":{"toasts":{}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"roleMappingsAPI":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"docLinks":{"mappingRoles":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/mapping-roles.html","createRoleMapping":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-api-put-role-mapping.html","createRoleMappingTemplates":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-api-put-role-mapping.html#_role_templates","roleMappingFieldRules":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/role-mapping-resources.html#mapping-roles-rule-field"},"history":{"action":"PUSH","length":1,"location":{"pathname":"/","search":"","hash":""}}}
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ describe('roleMappingsManagementApp', () => {
|
||||||
]);
|
]);
|
||||||
expect(container).toMatchInlineSnapshot(`
|
expect(container).toMatchInlineSnapshot(`
|
||||||
<div>
|
<div>
|
||||||
Role Mapping Edit Page: {"roleMappingsAPI":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"notifications":{"toasts":{}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit","search":"","hash":""}}}
|
Role Mapping Edit Page: {"roleMappingsAPI":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"notifications":{"toasts":{}},"docLinks":{"mappingRoles":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/mapping-roles.html","createRoleMapping":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-api-put-role-mapping.html","createRoleMappingTemplates":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-api-put-role-mapping.html#_role_templates","roleMappingFieldRules":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/role-mapping-resources.html#mapping-roles-rule-field"},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit","search":"","hash":""}}}
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ describe('roleMappingsManagementApp', () => {
|
||||||
]);
|
]);
|
||||||
expect(container).toMatchInlineSnapshot(`
|
expect(container).toMatchInlineSnapshot(`
|
||||||
<div>
|
<div>
|
||||||
Role Mapping Edit Page: {"name":"role@mapping","roleMappingsAPI":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"notifications":{"toasts":{}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit/role@mapping","search":"","hash":""}}}
|
Role Mapping Edit Page: {"name":"role@mapping","roleMappingsAPI":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"notifications":{"toasts":{}},"docLinks":{"mappingRoles":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/mapping-roles.html","createRoleMapping":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-api-put-role-mapping.html","createRoleMappingTemplates":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-api-put-role-mapping.html#_role_templates","roleMappingFieldRules":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/role-mapping-resources.html#mapping-roles-rule-field"},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit/role@mapping","search":"","hash":""}}}
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
|
|
@ -7,21 +7,25 @@
|
||||||
import { DocLinksStart } from 'src/core/public';
|
import { DocLinksStart } from 'src/core/public';
|
||||||
|
|
||||||
export class DocumentationLinksService {
|
export class DocumentationLinksService {
|
||||||
private readonly esDocBasePath: string;
|
private readonly esClusterPrivileges: string;
|
||||||
|
private readonly esRunAsPrivilege: string;
|
||||||
|
private readonly esIndicesPrivileges: string;
|
||||||
|
|
||||||
constructor(docLinks: DocLinksStart) {
|
constructor(docLinks: DocLinksStart) {
|
||||||
this.esDocBasePath = `${docLinks.ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${docLinks.DOC_LINK_VERSION}/`;
|
this.esClusterPrivileges = `${docLinks.links.security.clusterPrivileges}`;
|
||||||
|
this.esRunAsPrivilege = `${docLinks.links.security.runAsPrivilege}`;
|
||||||
|
this.esIndicesPrivileges = `${docLinks.links.security.indicesPrivileges}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getESClusterPrivilegesDocUrl() {
|
public getESClusterPrivilegesDocUrl() {
|
||||||
return `${this.esDocBasePath}security-privileges.html#privileges-list-cluster`;
|
return `${this.esClusterPrivileges}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getESRunAsPrivilegesDocUrl() {
|
public getESRunAsPrivilegesDocUrl() {
|
||||||
return `${this.esDocBasePath}security-privileges.html#_run_as_privilege`;
|
return `${this.esRunAsPrivilege}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getESIndicesPrivilegesDocUrl() {
|
public getESIndicesPrivilegesDocUrl() {
|
||||||
return `${this.esDocBasePath}security-privileges.html#privileges-list-indices`;
|
return `${this.esIndicesPrivileges}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ describe('rolesManagementApp', () => {
|
||||||
expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: `/`, text: 'Roles' }, { text: 'Create' }]);
|
expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: `/`, text: 'Roles' }, { text: 'Create' }]);
|
||||||
expect(container).toMatchInlineSnapshot(`
|
expect(container).toMatchInlineSnapshot(`
|
||||||
<div>
|
<div>
|
||||||
Role Edit Page: {"action":"edit","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit","search":"","hash":""}}}
|
Role Edit Page: {"action":"edit","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{"esClusterPrivileges":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-privileges.html#privileges-list-cluster","esRunAsPrivilege":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-privileges.html#_run_as_privilege","esIndicesPrivileges":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-privileges.html#privileges-list-indices"},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit","search":"","hash":""}}}
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ describe('rolesManagementApp', () => {
|
||||||
]);
|
]);
|
||||||
expect(container).toMatchInlineSnapshot(`
|
expect(container).toMatchInlineSnapshot(`
|
||||||
<div>
|
<div>
|
||||||
Role Edit Page: {"action":"edit","roleName":"role@name","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit/role@name","search":"","hash":""}}}
|
Role Edit Page: {"action":"edit","roleName":"role@name","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{"esClusterPrivileges":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-privileges.html#privileges-list-cluster","esRunAsPrivilege":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-privileges.html#_run_as_privilege","esIndicesPrivileges":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-privileges.html#privileges-list-indices"},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit/role@name","search":"","hash":""}}}
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ describe('rolesManagementApp', () => {
|
||||||
expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: `/`, text: 'Roles' }, { text: 'Create' }]);
|
expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: `/`, text: 'Roles' }, { text: 'Create' }]);
|
||||||
expect(container).toMatchInlineSnapshot(`
|
expect(container).toMatchInlineSnapshot(`
|
||||||
<div>
|
<div>
|
||||||
Role Edit Page: {"action":"clone","roleName":"someRoleName","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/clone/someRoleName","search":"","hash":""}}}
|
Role Edit Page: {"action":"clone","roleName":"someRoleName","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{"esClusterPrivileges":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-privileges.html#privileges-list-cluster","esRunAsPrivilege":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-privileges.html#_run_as_privilege","esIndicesPrivileges":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/security-privileges.html#privileges-list-indices"},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/clone/someRoleName","search":"","hash":""}}}
|
||||||
</div>
|
</div>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
import { DocLinksStart } from 'src/core/public';
|
import { DocLinksStart } from 'src/core/public';
|
||||||
|
|
||||||
export class DocumentationLinksService {
|
export class DocumentationLinksService {
|
||||||
private readonly esDocBasePath: string;
|
private readonly esEnableSecurity: string;
|
||||||
|
|
||||||
constructor(docLinks: DocLinksStart) {
|
constructor(docLinks: DocLinksStart) {
|
||||||
this.esDocBasePath = `${docLinks.ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${docLinks.DOC_LINK_VERSION}`;
|
this.esEnableSecurity = `${docLinks.links.security.elasticsearchEnableSecurity}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getEnableSecurityDocUrl() {
|
public getEnableSecurityDocUrl() {
|
||||||
return `${this.esDocBasePath}/get-started-enable-security.html?blade=kibanasecuritymessage`;
|
return `${this.esEnableSecurity}?blade=kibanasecuritymessage`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
import { DocLinksStart } from 'src/core/public';
|
import { DocLinksStart } from 'src/core/public';
|
||||||
|
|
||||||
export class DocumentationLinksService {
|
export class DocumentationLinksService {
|
||||||
private readonly kbn: string;
|
private readonly kbnPrivileges: string;
|
||||||
|
|
||||||
constructor(docLinks: DocLinksStart) {
|
constructor(docLinks: DocLinksStart) {
|
||||||
this.kbn = `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/`;
|
this.kbnPrivileges = `${docLinks.links.security.kibanaPrivileges}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getKibanaPrivilegesDocUrl() {
|
public getKibanaPrivilegesDocUrl() {
|
||||||
return `${this.kbn}kibana-privileges.html`;
|
return `${this.kbnPrivileges}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue