From 635697af71ed3940b12edabb36e2eb4d3f1c0de8 Mon Sep 17 00:00:00 2001 From: Deepak Prabhakara Date: Wed, 1 Nov 2023 23:40:50 +0000 Subject: [PATCH] fixed markdown and converted some camelCase to camel_case --- docs/retraced/apis/graphql.md | 12 +- docs/retraced/apis/index.md | 170 +++++++++--------- .../getting-started/first-audit-event.md | 2 +- 3 files changed, 97 insertions(+), 87 deletions(-) diff --git a/docs/retraced/apis/graphql.md b/docs/retraced/apis/graphql.md index 3e5ae07a..94b5640e 100644 --- a/docs/retraced/apis/graphql.md +++ b/docs/retraced/apis/graphql.md @@ -2,12 +2,12 @@ The recommended way to search events using an API is to POST your query and variables to the appropriate Retraced GraphQL endpoint. -| API | Endpoint | -| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Publisher | [http://localhost:3000/auditlog/publisher/v1/project/{projectId}/graphql](http://localhost:3000/auditlog/publisher/v1/project/{projectId}/graphql) | -| Admin | [http://localhost:3000/auditlog/admin/v1/project/{projectId}/environment/{environmentId}/graphql](http://localhost:3000/auditlog/admin/v1/project/{projectId}/environment/{environmentId}/graphql) | -| Enterprise | [http://localhost:3000/auditlog/enterprise/v1/graphql](http://localhost:3000/auditlog/enterprise/v1/graphql) | -| Viewer | [http://localhost:3000/auditlog/viewer/v1/graphql](http://localhost:3000/auditlog/viewer/v1/graphql) | +| API | Endpoint | +| ---------- | --------------------------------------------------------------------------------------------------- | +| Publisher | `http://localhost:3000/auditlog/publisher/v1/project/{project_id}/graphql` | +| Admin | `http://localhost:3000/auditlog/admin/v1/project/{project_id}/environment/{environment_id}/graphql` | +| Enterprise | `http://localhost:3000/auditlog/enterprise/v1/graphql` | +| Viewer | `http://localhost:3000/auditlog/viewer/v1/graphql` | ## Search diff --git a/docs/retraced/apis/index.md b/docs/retraced/apis/index.md index 870ec0fd..a946e3a7 100644 --- a/docs/retraced/apis/index.md +++ b/docs/retraced/apis/index.md @@ -1,61 +1,63 @@ # API Documentation + Retraced API ## Version: 1.4.6 - **License:** UNLICENSED ### /enterprise/v1/graphql #### POST + ##### Description: Query events with [GraphQL](/docs/retraced/apis/admin-api) ##### Parameters -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| Authorization | header | auth header of the form Token token= ... | Yes | string | +| Name | Located in | Description | Required | Schema | +| ------------- | ---------- | ---------------------------------------- | -------- | ------ | +| Authorization | header | auth header of the form Token token= ... | Yes | string | ##### Responses | Code | Description | | ---- | ----------- | -| 200 | OK | +| 200 | OK | null ### /enterprise/v1/search/active #### POST + ##### Description: Initiate an active search. An active search will maintain a persistent cursor that can be used at a later date to retrieve additional events from the search. - Authenticate with an Enterprise API token. ##### Parameters -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| Authorization | header | header of the form token= ... | Yes | string | +| Name | Located in | Description | Required | Schema | +| ------------- | ---------- | ----------------------------- | -------- | ------ | +| Authorization | header | header of the form token= ... | Yes | string | ##### Responses | Code | Description | | ---- | ----------- | -| 201 | Created | +| 201 | Created | null ### /enterprise/v1/search/saved #### POST + ##### Description: Create a saved search. @@ -65,21 +67,22 @@ Authenticate with an Enterprise API token. ##### Parameters -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| Authorization | header | header of the form token= ... | Yes | string | +| Name | Located in | Description | Required | Schema | +| ------------- | ---------- | ----------------------------- | -------- | ------ | +| Authorization | header | header of the form token= ... | Yes | string | ##### Responses | Code | Description | | ---- | ----------- | -| 201 | Created | +| 201 | Created | null -### /publisher/v1/project/{projectId}/event +### /publisher/v1/project/\{project_id\}/event #### POST + ##### Description: Create an event. Returns the id of the created event, and @@ -87,22 +90,23 @@ a cryptographic hash of the received event, as described [here](/docs/retraced/a ##### Parameters -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| Authorization | header | auth header of the form token= ... | Yes | string | -| projectId | path | the project id | Yes | string | +| Name | Located in | Description | Required | Schema | +| ------------- | ---------- | ---------------------------------- | -------- | ------ | +| Authorization | header | auth header of the form token= ... | Yes | string | +| project_id | path | the project id | Yes | string | ##### Responses | Code | Description | | ---- | ----------- | -| 201 | Created | +| 201 | Created | null -### /publisher/v1/project/{projectId}/event/bulk +### /publisher/v1/project/\{project_id\}/event/bulk #### POST + ##### Description: Create one or more events. Returns a list of the ids of the created event and @@ -110,22 +114,23 @@ a cryptographic hash of each received events, as described [here](/docs/retraced ##### Parameters -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| Authorization | header | auth header of the form token= ... | Yes | string | -| projectId | path | the project id | Yes | string | +| Name | Located in | Description | Required | Schema | +| ------------- | ---------- | ---------------------------------- | -------- | ------ | +| Authorization | header | auth header of the form token= ... | Yes | string | +| project_id | path | the project id | Yes | string | ##### Responses | Code | Description | | ---- | ----------- | -| 201 | Created | +| 201 | Created | null -### /publisher/v1/project/{projectId}/viewertoken +### /publisher/v1/project/\{project_id\}/viewertoken #### GET + ##### Description: Create a token for use with the Retraced embedded viewer as described [here](/docs/retraced/getting-started/embedded-viewer/). @@ -134,156 +139,161 @@ Create a token for use with the Retraced embedded viewer as described [here](/do ##### Parameters -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| Authorization | header | auth header of the form token= ... | Yes | string | -| projectId | path | the project id | Yes | string | -| actor_id | query | | Yes | string | -| group_id | query | The group identifier. Same as `team_id`. If both are passed, `group_id` will be used. | No | string | -| is_admin | query | Whether to display the Enterprise Settings and API Token Management. Set to `true` to show the settings. | No | string | -| target_id | query | If passed, only events relating to this target will be returned in a viewer that uses the token created | No | string | -| team_id | query | Same as `group_id`. If both are passed, `group_id` will be used. This field is deprecated. | No | string | -| view_log_action | query | The action that will be logged when the token is used | No | string | +| Name | Located in | Description | Required | Schema | +| --------------- | ---------- | -------------------------------------------------------------------------------------------------------- | -------- | ------ | +| Authorization | header | auth header of the form token= ... | Yes | string | +| project_id | path | the project id | Yes | string | +| actor_id | query | | Yes | string | +| group_id | query | The group identifier. Same as `team_id`. If both are passed, `group_id` will be used. | No | string | +| is_admin | query | Whether to display the Enterprise Settings and API Token Management. Set to `true` to show the settings. | No | string | +| target_id | query | If passed, only events relating to this target will be returned in a viewer that uses the token created | No | string | +| team_id | query | Same as `group_id`. If both are passed, `group_id` will be used. This field is deprecated. | No | string | +| view_log_action | query | The action that will be logged when the token is used | No | string | ##### Responses | Code | Description | | ---- | ----------- | -| 201 | Created | +| 201 | Created | null -### /publisher/v1/project/{projectId}/group/{groupId}/enterprisetoken +### /publisher/v1/project/\{project_id\}/group/\{group_id\}/enterprisetoken #### POST + ##### Description: Create a token for use with [Enterprise IT API](/docs/retraced/apis/enterprise-api/ ##### Parameters -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| Authorization | header | auth header of the form token= ... | Yes | string | -| projectId | path | the project id | Yes | string | -| groupId | path | The group identifier. The generated token will be scoped to the specified group. | Yes | string | +| Name | Located in | Description | Required | Schema | +| ------------- | ---------- | -------------------------------------------------------------------------------- | -------- | ------ | +| Authorization | header | auth header of the form token= ... | Yes | string | +| project_id | path | the project id | Yes | string | +| group_id | path | The group identifier. The generated token will be scoped to the specified group. | Yes | string | ##### Responses | Code | Description | | ---- | ----------- | -| 201 | Created | +| 201 | Created | null #### GET + ##### Description: List all [Enterprise IT API](/docs/retraced/apis/enterprise-api/) tokens. ##### Parameters -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| Authorization | header | auth header of the form token= ... | Yes | string | -| projectId | path | the project id | Yes | string | -| groupId | path | The group identifier. | Yes | string | +| Name | Located in | Description | Required | Schema | +| ------------- | ---------- | ---------------------------------- | -------- | ------ | +| Authorization | header | auth header of the form token= ... | Yes | string | +| project_id | path | the project id | Yes | string | +| group_id | path | The group identifier. | Yes | string | ##### Responses | Code | Description | | ---- | ----------- | -| 200 | OK | +| 200 | OK | null -### /publisher/v1/project/{projectId}/group/{groupId}/enterprisetoken/{tokenId} +### /publisher/v1/project/\{project_id\}/group/\{group_id\}/enterprisetoken/\{token_id\} #### GET + ##### Description: Retrieve an [Enterprise IT API](/docs/retraced/apis/enterprise-api/) token. ##### Parameters -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| Authorization | header | auth header of the form token= ... | Yes | string | -| projectId | path | The project id. | Yes | string | -| groupId | path | The group identifier. | Yes | string | -| tokenId | path | The token id. | Yes | string | +| Name | Located in | Description | Required | Schema | +| ------------- | ---------- | ---------------------------------- | -------- | ------ | +| Authorization | header | auth header of the form token= ... | Yes | string | +| project_id | path | The project id. | Yes | string | +| group_id | path | The group identifier. | Yes | string | +| token_id | path | The token id. | Yes | string | ##### Responses | Code | Description | | ---- | ----------- | -| 200 | OK | +| 200 | OK | null #### PUT + ##### Description: Update an [Enterprise IT API](/docs/retraced/apis/enterprise-api/) token ##### Parameters -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| Authorization | header | auth header of the form token= ... | Yes | string | -| projectId | path | the project id | Yes | string | -| groupId | path | The group identifier. | Yes | string | -| tokenId | path | The token to update. | Yes | string | +| Name | Located in | Description | Required | Schema | +| ------------- | ---------- | ---------------------------------- | -------- | ------ | +| Authorization | header | auth header of the form token= ... | Yes | string | +| project_id | path | the project id | Yes | string | +| group_id | path | The group identifier. | Yes | string | +| token_id | path | The token to update. | Yes | string | ##### Responses | Code | Description | | ---- | ----------- | -| 200 | OK | +| 200 | OK | null #### DELETE + ##### Description: Delete an [Enterprise IT API](/docs/retraced/apis/enterprise-api/) token - ##### Parameters -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| Authorization | header | auth header of the form token= ... | Yes | string | -| projectId | path | the project id | Yes | string | -| groupId | path | The group identifier. | Yes | string | -| tokenId | path | The token to delete. | Yes | string | +| Name | Located in | Description | Required | Schema | +| ------------- | ---------- | ---------------------------------- | -------- | ------ | +| Authorization | header | auth header of the form token= ... | Yes | string | +| project_id | path | the project id | Yes | string | +| group_id | path | The group identifier. | Yes | string | +| token_id | path | The token to delete. | Yes | string | ##### Responses | Code | Description | | ---- | ----------- | -| 204 | Deleted | +| 204 | Deleted | null -### /publisher/v1/project/{projectId}/graphql +### /publisher/v1/project/\{project_id\}/graphql #### POST + ##### Description: Query events with [GraphQL](/docs/retraced/apis/graphql/) ##### Parameters -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| Authorization | header | auth header of the form Token token= ... | Yes | string | -| projectId | path | the project id | Yes | string | +| Name | Located in | Description | Required | Schema | +| ------------- | ---------- | ---------------------------------------- | -------- | ------ | +| Authorization | header | auth header of the form Token token= ... | Yes | string | +| project_id | path | the project id | Yes | string | ##### Responses | Code | Description | | ---- | ----------- | -| 200 | OK | +| 200 | OK | null diff --git a/docs/retraced/getting-started/first-audit-event.md b/docs/retraced/getting-started/first-audit-event.md index f44f0df1..8baf4caa 100644 --- a/docs/retraced/getting-started/first-audit-event.md +++ b/docs/retraced/getting-started/first-audit-event.md @@ -13,7 +13,7 @@ the Retraced admin site. ### Sending Events -Next, in your Login API handler, you'll want to add a call to the Publisher API's after each login attempt. The Create Event call can be made using one of the [Retraced SDKs](/docs/retraced/sdks/available-sdks), or by making a request to `POST /publisher/v1/project/{projectId}/event` as described in the [Publisher API Documentation](/docs/retraced/apis/publisher-api) and the [Publisher Swagger Specification](http://localhost:3000/auditlog/publisher/v1/swagger.json). +Next, in your Login API handler, you'll want to add a call to the Publisher API's after each login attempt. The Create Event call can be made using one of the [Retraced SDKs](/docs/retraced/sdks/available-sdks), or by making a request to `POST /publisher/v1/project/{project_id}/event` as described in the [Publisher API Documentation](/docs/retraced/apis/publisher-api) and the [Publisher Swagger Specification](http://localhost:3000/auditlog/publisher/v1/swagger.json). ### Verifying Event Hashes