浏览代码

Revert "Switch to response_calls.auth rather than auth.use_value"

This reverts commit 24df18ba
shalvah 4 年之前
父节点
当前提交
8b63170945

+ 7 - 6
config/scribe.php

@@ -61,6 +61,13 @@ return [
          */
         'name' => 'token',
 
+        /*
+         * The value of the parameter to be used by Scribe to authenticate response calls.
+         * This will NOT be included in the generated documentation.
+         * If this value is empty, Scribe will use a random value.
+         */
+        'use_value' => env('SCRIBE_AUTH_KEY'),
+
         /*
          * Any extra authentication-related info for your users. For instance, you can describe how to find or generate their auth credentials.
          * Markdown and HTML are supported.
@@ -242,12 +249,6 @@ INTRO
                         // 'app.debug' => false,
                     ],
 
-                    /*
-                     * The value of the auth parameter (described in your auth section above) to be used by Scribe to authenticate response calls.
-                     * If this value is empty, Scribe will use a random value.
-                     */
-                    'auth' => env('SCRIBE_AUTH_KEY'),
-
                     /*
                      * Cookies which should be sent with the API call.
                      */

+ 2 - 0
docs/config.md

@@ -98,6 +98,8 @@ Here are the available settings:
 
 - `name`: The name of the parameter (eg `token`, `key`, `apiKey`) or header (eg `Authorization`, `Api-Key`). When `in` is set to `bearer` or `basic`, this value will be ignored, and the header used will be `Authorization`.
 
+- `use_value`: The value of the parameter to be used by Scribe to authenticate response calls. This will **not** be included in the generated documentation. If this value is null, Scribe will use a random value.
+
 - `extra_info`: Any extra authentication-related info for your users. For instance, you can describe how to find or generate their auth credentials. Markdown and HTML are supported. This will be included in the `Authentication` section.
 
 ### `strategies`

+ 4 - 1
docs/documenting/documenting-api-information.md

@@ -18,6 +18,7 @@ Here's how you'd configure auth with a query parameter named `apiKey`:
         'enabled' => true,
         'in' => 'query',
         'name' => 'apiKey',
+        'use_value' => env('SCRIBE_API_KEY'),
         'extra_info' => 'You can retrieve your key by going to settings and clicking <b>Generate API key</b>.',
     ],
 ```
@@ -32,6 +33,7 @@ Here's an example with a bearer token (also applies to basic auth, if you change
         'enabled' => true,
         'in' => 'bearer',
         'name' => 'hahaha', // <--- This value is ignored for bearer and basic auth
+        'use_value' => env('SCRIBE_AUTH_KEY'),
         'extra_info' => 'You can retrieve your token by visiting your dashboard and clicking <b>Generate API token</b>.',
     ],
 ```
@@ -44,13 +46,14 @@ And here's an example with a custom header:
         'enabled' => true,
         'in' => 'header',
         'name' => 'Api-Key', // <--- The name of the header
+        'use_value' => env('SCRIBE_AUTH_KEY'),
         'extra_info' => 'You can retrieve your token by visiting your dashboard and clicking <b>Generate API token</b>.',
     ],
 ```
 
 You can set whatever you want as the `extra_info`. A good idea would be to tell your users where to get their auth key. 
 
-You can also specify the value Scribe should use for response calls by setting `response_calls.auth`. This value will only be used to authenticate calls to endpoints marked as authenticated; it won't be included in the generated output or examples.
+The `use_value` field is only used by Scribe for response calls. It won't be included in the generated output or examples.
 
 For more information, see the [reference documentation on the auth section](../config.html#auth).
 

+ 0 - 2
docs/documenting/documenting-endpoint-responses.md

@@ -135,8 +135,6 @@ The configuration for response calls is located in the `apply.response_calls` se
 .. Tip:: You can also modify the environment directly by using a :code:`.env.docs` file and running :code:`scribe:generate` with :code:`--env docs`.
 ```
 
-- If you have authenticated endpoints, you can use `response_calls.auth` to authenticate your response calls. Set it to the value of the auth parameter. Scribe combines this with the information in your `auth` section to authenticate your requests. If this value is empty, Scribe will use a random value. 
-
 - By default, the package will generate dummy values for your documented query, body and file parameters and send in the request. If you specified example values using `@bodyParam` or `@queryParam`, those will be used instead. You can configure additional parameters or overwrite the existing ones for the request in the `response_calls.queryParams`, `response_calls.bodyParams`, and `response_calls.fileParams` sections. For file parameters, each value should be a valid absolute path to a file on the machine.
 
 ```eval_rst

+ 2 - 2
src/Writing/PostmanCollectionWriter.php

@@ -33,7 +33,7 @@ class PostmanCollectionWriter
         $this->auth = config('scribe.postman.auth');
 
         if ($this->auth) {
-            c::deprecated('the `postman.auth` config item', 'use the `postman.overrides` feature');
+            c::deprecated('the `postman.auth` config setting', 'the `postman.overrides` setting');
         }
     }
 
@@ -42,7 +42,7 @@ class PostmanCollectionWriter
         $description = config('scribe.postman.description', '');
 
         if ($description) {
-            c::deprecated('the `postman.description` config item', 'use the `description` item');
+            c::deprecated('the `postman.description` config setting', 'the `description` setting');
         } else {
             $description = config('scribe.description', '');
         }