Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account-scoped personal access tokens #4805

Merged
merged 12 commits into from
Feb 7, 2024
Merged

Account-scoped personal access tokens #4805

merged 12 commits into from
Feb 7, 2024

Conversation

matthewshaver
Copy link
Contributor

@matthewshaver matthewshaver commented Jan 25, 2024

What are you changing in this pull request and why?

Updating the docs to reflect the change to account-scoped personal access tokens for APIs.
Renames the Authentication section to API Access and updates the Authentication page to Authentication tokens
No redirects required as URLs remain the same.

Checklist

Adding or removing pages (delete if not applicable):

  • Add/remove page in website/sidebars.js
  • Provide a unique filename for new pages
  • Run link testing locally with npm run build to update the links that point to deleted pages

@matthewshaver matthewshaver requested a review from a team as a code owner January 25, 2024 21:08
Copy link

vercel bot commented Jan 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-getdbt-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2024 9:03pm

@github-actions github-actions bot added the content Improvements or additions to content label Jan 25, 2024
@matthewshaver matthewshaver requested a review from BrJan January 25, 2024 21:08
@github-actions github-actions bot added size: medium This change will take up to a week to address Docs team Authored by the Docs team @dbt Labs labels Jan 25, 2024
Copy link
Contributor

@BrJan BrJan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! We may need some time though to agree on when to roll this out, at least we need to push the deprecation date past January.

* For example, [email protected] belongs to two dbt Cloud accounts: Spice Harvesting Account and Guild Navigator Account. Before this release, the same API key was used to access both accounts.
* After this release, Paul has to individually go into these accounts and create a unique PAT for each account he wants to access the API. These API tokens are account-specific and not user-specific.
* **Cross-Account API endpoints will stop working after April X, 2024:**
* These are /v2/accounts and /v3/accounts. Since all tokens are now account-specific, tying all accounts to a username will not work. So /v3/accounts will be deprecated.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we can't deprecate /v3/accounts because it's used on the front end for the account switcher. Once we fully migrate to MC then we might be able to

description: "Personal access tokens help you define permissions for securing access to your dbt Cloud account and its projects."
---

Each dbt Cloud user with a [developer license](https://docs.getdbt.com/docs/cloud/manage-access/seats-and-users) can create a personal access token (PAT) to access the dbt Cloud API. This token is used to execute queries against the dbt Cloud API on the user's behalf. User API tokens inherit the permissions of the user that they were created for. These tokens are account-specific; If a user has access to more than one dbt Cloud account with the same email address, you need to create a unique PAT for each one of these accounts.
Copy link
Contributor

@nm0s nm0s Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might explicitly mention somewhere that account-scoped PATs can only query "accounts-level" endpoints (as in endpoints that have an account id within their either request path). With the exception of /whoami, /v3/accounts, and /v2/accounts

@matthewshaver matthewshaver changed the title [DRAFT]Account-scoped personal access tokens Account-scoped personal access tokens Feb 7, 2024
Copy link
Collaborator

@runleonarun runleonarun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments that you can iterate on after you ship if you want!

website/docs/docs/dbt-cloud-apis/authentication.md Outdated Show resolved Hide resolved
@@ -4,19 +4,72 @@ id: "user-tokens"
pagination_next: "docs/dbt-cloud-apis/service-tokens"
---

:::note Action required

The [user API tokens](#user-tokens) will eventually be deprecated. The deprecation date is yet to be determined, but we recommend you update to account-scoped personal access tokens to avoid service disruptions in the future. We will communicate, with ample notice, the deprecation date when it has been determined.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This note is kind of wordy and could use some fine-tuning. I worry people will miss the important bits.


:::info New

On Feb 7, 2024, we introduced a new type of token for individual users called personal access tokens. Note that these differ from [Service Tokens or API Keys](/docs/dbt-cloud-apis/authentication#types-of-api-access-tokens). Before this release, user API keys were the only way to access dbt Cloud API on behalf of the user. These API Keys were user-specific and were not scoped to an account. To enhance the security of dbt Cloud, we are moving away from this model to account-specific tokens.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be a note? Feels like a 1st paragraph?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've worked under the assumption that anything with dates should be temporary text, but I'm happy to change it.

@matthewshaver matthewshaver merged commit e5945d3 into current Feb 7, 2024
7 checks passed
@matthewshaver matthewshaver deleted the pat branch February 7, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content Docs team Authored by the Docs team @dbt Labs February-2024 size: medium This change will take up to a week to address
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants