Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Jul 7, 2020
1 parent 05985af commit 1133469
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ How to add a record in audit log:

```typescript
router.get({ path: '/my_endpoint', validate: false }, async (context, request, response) => {
context.core.auditor.withScope('my_plugin_operation');
context.core.auditor.withAuditScope('my_plugin_operation');
const value = await context.core.elasticsearch.legacy.client.callAsCurrentUser('...');
context.core.add({ type: 'operation.type', message: 'perform an operation in ... endpoint' });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export interface Auditor
| Method | Description |
| --- | --- |
| [add(event)](./kibana-plugin-core-server.auditor.add.md) | Add a record to audit log. Service attaches to a log record: - metadata about an end-user initiating an operation - scope name, if presents |
| [withScope(name)](./kibana-plugin-core-server.auditor.withscope.md) | Add a high-level scope name for logged events. It helps to identify the root cause of low-level events. |
| [withAuditScope(name)](./kibana-plugin-core-server.auditor.withauditscope.md) | Add a high-level scope name for logged events. It helps to identify the root cause of low-level events. |

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Auditor](./kibana-plugin-core-server.auditor.md) &gt; [withScope](./kibana-plugin-core-server.auditor.withscope.md)
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Auditor](./kibana-plugin-core-server.auditor.md) &gt; [withAuditScope](./kibana-plugin-core-server.auditor.withauditscope.md)

## Auditor.withScope() method
## Auditor.withAuditScope() method

Add a high-level scope name for logged events. It helps to identify the root cause of low-level events.

<b>Signature:</b>

```typescript
withScope(name: string): void;
withAuditScope(name: string): void;
```

## Parameters
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [HttpServerInfo](./kibana-plugin-core-server.httpserverinfo.md) &gt; [hostname](./kibana-plugin-core-server.httpserverinfo.hostname.md)

## HttpServerInfo.hostname property

The hostname of the server

<b>Signature:</b>

```typescript
hostname: string;
```
2 changes: 1 addition & 1 deletion src/core/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export interface AuditableEvent {
// @public
export interface Auditor {
add(event: AuditableEvent): void;
withScope(name: string): void;
withAuditScope(name: string): void;
}

// @public
Expand Down

0 comments on commit 1133469

Please sign in to comment.