Skip to content

Commit

Permalink
GITBOOK-7284: API: GS-First round of content shuffling. Lots of littl…
Browse files Browse the repository at this point in the history
…e changes.
  • Loading branch information
awileysnyk authored and gitbook-bot committed Jun 12, 2024
1 parent f590540 commit 218640e
Show file tree
Hide file tree
Showing 73 changed files with 351 additions and 455 deletions.
133 changes: 68 additions & 65 deletions docs/SUMMARY.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/enterprise-configuration/service-accounts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ From the **Role** dropdown list, select an appropriate role.

For Group service accounts, choose from the following list of roles to configure the scope of the token; Snyk recommends selecting Viewer or Admin.

* **Group Viewer** enables read-only access. Note that to set an API token to be read-only and unable to write to the platform, you must use a service account and set it to Group Viewer. See [Snyk API token permissions users can control](../../snyk-api/authentication-for-api/api-token-permissions-users-can-control.md).
* **Group Viewer** enables read-only access. Note that to set an API token to be read-only and unable to write to the platform, you must use a service account and set it to Group Viewer. See [Snyk API token permissions users can control](../../snyk-api/snyk-rest-api-overview/authentication-for-api/api-token-permissions-users-can-control.md).
* **Group Admin** enables full administrator access.
* **Group Member** associates a service account with a group but does not grant any specific access.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Specific permissions are required to perform all these tasks; see [Service accou

**API documentation:** [https://apidocs.snyk.io/#get-/groups/-group\_id-/service\_accounts](https://apidocs.snyk.io/?version=2023-09-07#get-/groups/-group\_id-/service\_accounts)

This [paginated](../../snyk-api/make-calls-to-the-snyk-api/links-for-pagination-in-snyk-rest-api.md) call returns an array of objects, each describing a service account.
This [paginated](../../snyk-api/snyk-rest-api-overview/links-for-pagination-in-snyk-rest-api.md) call returns an array of objects, each describing a service account.

### Create a service account for your Group

Expand Down Expand Up @@ -86,7 +86,7 @@ This call allows you to manage the client secret for `oauth_client_secret` servi

**API documentation:** [https://apidocs.snyk.io/#get-/orgs/-org\_id-/service\_accounts](https://apidocs.snyk.io/?version=2023-09-07#get-/orgs/-org\_id-/service\_accounts)

This [paginated](../../snyk-api/make-calls-to-the-snyk-api/links-for-pagination-in-snyk-rest-api.md) call returns an array of objects, each describing a service account.
This [paginated](../../snyk-api/snyk-rest-api-overview/links-for-pagination-in-snyk-rest-api.md) call returns an array of objects, each describing a service account.

### Create a service account for your Organization

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Enterprise users have access to a personal token under their profile and to serv
* Authenticating with the IDE manually
* Running API calls one time, for example, to test something

For more information on the personal Snyk API token, see the following pages: [Authenticate the CLI with your account](../snyk-cli/authenticate-the-cli-with-your-account.md) and [Authentication for API](../snyk-api/authentication-for-api/).
For more information on the personal Snyk API token, see the following pages: [Authenticate the CLI with your account](../snyk-cli/authenticate-the-cli-with-your-account.md) and [Authentication for API](../snyk-api/snyk-rest-api-overview/authentication-for-api/).

{% hint style="info" %}
If you are using Snyk on the EU and AU tenants, you must set your endpoints accordingly before authenticating. For more information, see [Regional hosting and data residency](../working-with-snyk/regional-hosting-and-data-residency.md).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ To continuously avoid known vulnerabilities in your dependencies, integrate Snyk

### Set up automatic monitoring

If you monitor a Project with Snyk, you will be notified if the dependencies in your Project are affected by newly disclosed vulnerabilities. To ensure the list of dependencies Snyk has for your Open Source Project is up to date, refresh it continuously by running s`nyk monitor` in your deployment process. Configure your environment to include the `SNYK_TOKEN` environment variable. You can [find your API token ](../../../snyk-api/authentication-for-api/)in your Snyk account settings.
If you monitor a Project with Snyk, you will be notified if the dependencies in your Project are affected by newly disclosed vulnerabilities. To ensure the list of dependencies Snyk has for your Open Source Project is up to date, refresh it continuously by running s`nyk monitor` in your deployment process. Configure your environment to include the `SNYK_TOKEN` environment variable. You can [find your API token ](../../../snyk-api/snyk-rest-api-overview/authentication-for-api/)in your Snyk account settings.

### API token configuration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Visual Studio Code extension authentication

To scan your projects you must authenticate with Snyk. The extension uses your Snyk API [token](../../../snyk-api/authentication-for-api/) for authentication. To store the token securely, Snyk uses [Secret Storage API](https://code.visualstudio.com/api/references/vscode-api#SecretStorage), which uses the system's keychain to manage the token.
To scan your projects you must authenticate with Snyk. The extension uses your Snyk API [token](../../../snyk-api/snyk-rest-api-overview/authentication-for-api/) for authentication. To store the token securely, Snyk uses [Secret Storage API](https://code.visualstudio.com/api/references/vscode-api#SecretStorage), which uses the system's keychain to manage the token.

## Logging in

Expand All @@ -27,7 +27,7 @@ To re-authenticate with a different account, follow these steps:

![Snyk: Log Out](<../../../.gitbook/assets/logging-out-command (1).png>)

Or you run `Snyk: Set Token` command and set your [token](../../../snyk-api/authentication-for-api/) in the text field manually.
Or you run `Snyk: Set Token` command and set your [token](../../../snyk-api/snyk-rest-api-overview/authentication-for-api/) in the text field manually.

![Set token manually](<../../../.gitbook/assets/image (224) (1) (1) (1) (1) (1) (1) (1) (1).png>)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can also authenticate using Options. Open Visual Studio **Options** and go t

![Options and settings button](../../../.gitbook/assets/readme\_image\_2\_5.png)

If the automated method does not work, you can trigger authentication by pressing the **Authenticate** button or entering the user API [token](../../../snyk-api/authentication-for-api/) manually. If you must enter your token, use your personal token. For more information, see [How to obtain and authenticate with your Snyk API token](../../../getting-started/how-to-obtain-and-authenticate-with-your-snyk-api-token.md). You can also submit a request to [Snyk support](https://snyk.zendesk.com/agent/dashboard).
If the automated method does not work, you can trigger authentication by pressing the **Authenticate** button or entering the user API [token](../../../snyk-api/snyk-rest-api-overview/authentication-for-api/) manually. If you must enter your token, use your personal token. For more information, see [How to obtain and authenticate with your Snyk API token](../../../getting-started/how-to-obtain-and-authenticate-with-your-snyk-api-token.md). You can also submit a request to [Snyk support](https://snyk.zendesk.com/agent/dashboard).

![Token field and Authenticate button](../../../.gitbook/assets/readme\_image\_2\_6.png)

Expand Down
20 changes: 1 addition & 19 deletions docs/snyk-api-info/snyk-webhooks/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# Snyk Webhooks

### Snyk Webhooks for Snyk API

[Visit the Snyk API documentation for Webhooks](https://snyk.docs.apiary.io/#introduction/consuming-webhooks) to get information on consuming, validating, and examples.

{% embed url="https://snyk.docs.apiary.io/#introduction/consuming-webhooks" %}
# Webhooks

Webhooks allow you to be notified of Snyk system events, enabling you to build notifications and react to changes in your projects. The current implementation supports events for recurring scans of open source and container image related projects.

Expand All @@ -28,18 +22,6 @@ Get real-time security alerts aggregated across various sources into a single pl

Browse the various [Snyk Partner integrations](../../integrate-with-snyk/vulnerability-management-tools/) for a comprehensive list of solutions.

### Webhook headers

Event messages are delivered with a ​`Content-Type​` of ​`application/json`,​ with the event payload as JSON in the request body. We also send the following headers:

* `X-Snyk-Event` the name of the event and the version of the payload, such as `ping/v1`
* `X-Snyk-Transport-ID` a GUID to identify this delivery
*`X-Snyk-Timestamp`an ISO 8601 timestamp for when the event occurred, e.g. `2020-09-25T15:27:53Z`
* `X-Hub-Signature` the HMAC hex digest of the request body which is used to secure your webhooks and ensure the request did indeed come from Snyk
* `User-Agent​` identifies the origin of the request, e.g. ​`Snyk-Webhooks/XXX`

Each webhook receives all events.

### Security SSL

Webhooks can only be configured for URLs using the HTTPS protocol. HTTP is not allowed.
Expand Down

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion docs/snyk-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Snyk [extensibility and the Snyk API](https://snyk.io/blog/extensibility-and-the

## Snyk REST API

The [Snyk REST API](https://apidocs.snyk.io/) is based on the OpenAPI and JSON:API standards and represents an evolutionary approach to API development, with each endpoint versioned. For more information, see [Versioning](https://apidocs.snyk.io/#overview) in the reference docs. The most recent version of the REST API endpoints is also available in the [Reference](reference/) in the Snyk user docs along with the current [REST API overview](snyk-rest-api-overview.md).
The [Snyk REST API](https://apidocs.snyk.io/) is based on the OpenAPI and JSON:API standards and represents an evolutionary approach to API development, with each endpoint versioned. For more information, see [Versioning](https://apidocs.snyk.io/#overview) in the reference docs. The most recent version of the REST API endpoints is also available in the [Reference](reference/) in the Snyk user docs along with the current [REST API overview](snyk-rest-api-overview/).

## Snyk V1 API (superseded by the REST API)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# How to find information about Snyk API endpoints
# API endpoints index and notes

This list includes the categories and names of REST GA and beta and V1 API endpoints, with the URL in the reference docs for each endpoint, and links to related information where available. REST is the default, and GA is the status unless beta is noted. V1 API is specified where applicable. This listing is a work in progress; additional information is being added continually.

Expand Down Expand Up @@ -202,7 +202,7 @@ This list includes the categories and names of REST GA and beta and V1 API endpo

#### List all dependencies

[Migrated List all dependencies](how-to-find-information-about-snyk-api-endpoints.md#list-all-dependencies)
[Migrated List all dependencies](api-endpoints-index-and-notes.md#list-all-dependencies)

## Entitlements (v1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The recommended approach to testing and monitoring your dependencies managed by
Follow these basic steps:

1. For each type of dependency (for example, Maven, Cocoapods), create a [Dep Graph JSON object](https://github.com/snyk/dep-graph) listing all the dependency packages and versions. For an example, see the Snyk user docs [Bazel](../../getting-started/supported-languages-and-frameworks/bazel.md) page.
2. As part of a Bazel test rule, send the Dep Braph JSON object as a POST request to the [Dep Graph Test API](https://snyk.docs.apiary.io/#reference/test/dep-graph), along with your [auth token](../authentication-for-api/). An example curl request follows:
2. As part of a Bazel test rule, send the Dep Braph JSON object as a POST request to the [Dep Graph Test API](https://snyk.docs.apiary.io/#reference/test/dep-graph), along with your [auth token](../snyk-rest-api-overview/authentication-for-api/). An example curl request follows:

```
curl -X POST 'https://snyk.io/api/v1/test/dep-graph' \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Testing your SBOM can be a long-running operation. Instead of waiting until the
Follow these steps to test an SBOM:

1. Log in to the Snyk Web UI and retrieve your Organization ID (UUID format), Project ID (UUID), and API key.\
If you need help in finding these values, see [Group and Organization navigation](../../snyk-admin/groups-and-organizations/switch-between-groups-and-organizations.md), [View Project settings](../../snyk-admin/snyk-projects/view-and-edit-project-settings.md), and [Authentication for API](../authentication-for-api/).
If you need help in finding these values, see [Group and Organization navigation](../../snyk-admin/groups-and-organizations/switch-between-groups-and-organizations.md), [View Project settings](../../snyk-admin/snyk-projects/view-and-edit-project-settings.md), and [Authentication for API](../snyk-rest-api-overview/authentication-for-api/).
2. Use any HTTP client, for example, `curl` or Postman, to make a request to the endpoint [Create an SBOM test run](https://apidocs.snyk.io/?version=2023-10-24%7Ebeta#post-/orgs/-org\_id-/sbom\_tests).&#x20;

{% hint style="info" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SBOM documents can be generated in [CycloneDX](https://cyclonedx.org/) v1.4 (JSO
## How to generate the SBOM for a project

1. On the Snyk Web UI, retrieve your organization ID (UUID format), project ID (UUID) and API key.\
If you need help in finding these values, see [Group and Organization navigation](../../snyk-admin/groups-and-organizations/switch-between-groups-and-organizations.md), [View project settings](../../snyk-admin/snyk-projects/view-and-edit-project-settings.md), and [Authentication for API](../authentication-for-api/).
If you need help in finding these values, see [Group and Organization navigation](../../snyk-admin/groups-and-organizations/switch-between-groups-and-organizations.md), [View project settings](../../snyk-admin/snyk-projects/view-and-edit-project-settings.md), and [Authentication for API](../snyk-rest-api-overview/authentication-for-api/).
2. Determine the format you want for the SBOM you will generate.\
Available options are CycloneDX 1.4 JSON (`cyclonedx1.4+json`), CycloneDX 1.4 XML (`cyclonedx1.4+xml`) or SPDX v2.3 JSON (`spdx2.3+json`).
3. Using any HTTP client, for example, Postman or `curl`, make a request to the endpoint.\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Follow these steps to make a simple call to the Snyk REST API.
2. Log in to [Snyk](https://snyk.io/).
3. Navigate to the **Org Settings** (gear icon) for an organization where you have projects you can list.
4. Find the **Organization ID** so you can copy the value when you make the API call.
5. Navigate to the Snyk REST API and authenticate. For instructions, see See [Authentication for API](../authentication-for-api/).
5. Navigate to the Snyk REST API and authenticate. For instructions, see See [Authentication for API](../snyk-rest-api-overview/authentication-for-api/).
6. Observe that the Snyk REST API opens to the most recent GA version.
7. Look for the **Projects** endpoints and navigate to `GET/orgs/{org_id}/projects` ([List all Projects for an Org with the given Org ID](https://apidocs.snyk.io/?#get-/orgs/-org\_id-/projects)).
8. Copy your **Organization ID** from your **Org settings** and paste the ID into the **PATH PARAMETERS** `org_id` field (asterisk designates a required request parameter).
Expand Down
Loading

0 comments on commit 218640e

Please sign in to comment.