From 3a0dc13fc78086c08c81bbf59d55078fd622d6dd Mon Sep 17 00:00:00 2001 From: rhymes Date: Fri, 6 Sep 2019 15:08:39 +0200 Subject: [PATCH] Replace "access token" with "API Key" (#3960) [ci skip] --- app/controllers/api_secrets_controller.rb | 4 ++-- app/views/users/_account.html.erb | 14 +++++++------- docs/api_v0.yml | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/controllers/api_secrets_controller.rb b/app/controllers/api_secrets_controller.rb index 4dbda4850..ecddae27f 100644 --- a/app/controllers/api_secrets_controller.rb +++ b/app/controllers/api_secrets_controller.rb @@ -9,7 +9,7 @@ class ApiSecretsController < ApplicationController @secret.user_id = current_user.id if @secret.save - flash[:notice] = "Your access token has been generated: #{@secret.secret}" + flash[:notice] = "Your API Key has been generated: #{@secret.secret}" else flash[:error] = @secret.errors.full_messages.to_sentence end @@ -21,7 +21,7 @@ class ApiSecretsController < ApplicationController authorize @secret if @secret.destroy - flash[:notice] = "Your access token has been revoked." + flash[:notice] = "Your API Key has been revoked." else flash[:error] = "An error occurred. Please try again or send an email to: yo@dev.to" end diff --git a/app/views/users/_account.html.erb b/app/views/users/_account.html.erb index b5a9e1816..c48509668 100644 --- a/app/views/users/_account.html.erb +++ b/app/views/users/_account.html.erb @@ -16,22 +16,22 @@
<% end %> -

DEV API Access Tokens

-

You can generate personal access tokens to use for authentication with the DEV API. The API is still in early beta though. The DEV API documentation contains further information.

-

Generate an access token

+

DEV API Keys

+

You can generate personal API keys to use for authentication with the DEV API. The API is still in early beta though. The DEV API documentation contains further information.

+

Generate a new Key

<%= form_tag users_api_secrets_path, method: :post do %> <%= fields_for :api_secret do |api_secret| %>
- <%= api_secret.label(:description, "Token Description") %> - <%= api_secret.text_field(:description, placeholder: "What's this token for?", required: true) %> + <%= api_secret.label(:description, "Description") %> + <%= api_secret.text_field(:description, placeholder: "What's this API key for?", required: true) %>
<% end %> <% end %> -

Active access tokens (Never share these secrets!)

+

Active API keys (never share these!)

<% if @user.api_secrets.empty? %>

None yet!

<% end %> diff --git a/docs/api_v0.yml b/docs/api_v0.yml index 64f442392..8e88354f0 100644 --- a/docs/api_v0.yml +++ b/docs/api_v0.yml @@ -25,19 +25,19 @@ components: API Key authentication. Authentication for some endpoints, like write operations on the - Articles API require an API key (DEV API access token). + Articles API require a DEV API key. ### Getting an API key To obtain one, please follow these steps: - visit https://dev.to/settings/account - - in the "DEV API Access Tokens" section create a new token by adding a - description and clicking on "Generate Token" + - in the "DEV API Keys" section create a new key by adding a + description and clicking on "Generate API Key" - ![obtain a DEV API access token](https://res.cloudinary.com/practicaldev/image/fetch/s--F4Ya4WgC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/4zm0cbutj9o9eau0jm9t.png) - - You'll see the newly generated token in the same view - ![generated DEV API access token](https://res.cloudinary.com/practicaldev/image/fetch/s--kp5L6-9G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ra01mo6fp1es261db2ho.png) + ![obtain a DEV API Key](https://user-images.githubusercontent.com/146201/64421366-af3f8b00-d0a1-11e9-8ff6-7cc0ca6e854e.png) + - You'll see the newly generated key in the same view + ![generated DEV API Key](https://user-images.githubusercontent.com/146201/64421367-af3f8b00-d0a1-11e9-9831-73d3bdfdff66.png) name: api-key in: header oauth2: