Skip to content

Commit fcbe18c

Browse files
committed
clarify auth
1 parent 20869df commit fcbe18c

4 files changed

Lines changed: 276 additions & 43 deletions

File tree

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@ require_once(__DIR__ . '/vendor/autoload.php');
4949

5050

5151

52+
// Configure API key authorization: api_key
53+
$config = FastComments\Client\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
54+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
55+
// $config = FastComments\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
56+
5257

5358
$apiInstance = new FastComments\Client\Api\DefaultApi(
5459
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
5560
// This is optional, `GuzzleHttp\Client` will be used as default.
56-
new GuzzleHttp\Client()
61+
new GuzzleHttp\Client(),
62+
$config
5763
);
5864
$tenant_id = 'tenant_id_example'; // string
5965
$add_domain_config_params = new \FastComments\Client\Model\AddDomainConfigParams(); // \FastComments\Client\Model\AddDomainConfigParams
@@ -267,7 +273,14 @@ Class | Method | HTTP request | Description
267273
- [VoteStyle](docs/Model/VoteStyle.md)
268274

269275
## Authorization
270-
Endpoints do not require authorization.
276+
277+
Authentication schemes defined for the API:
278+
### api_key
279+
280+
- **Type**: API key
281+
- **API key parameter name**: x-api-key
282+
- **Location**: HTTP header
283+
271284

272285
## Tests
273286

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
"developerOrganizationUrl": "https://fastcomments.com",
1616
"gitRepoId": "fastcomments-php",
1717
"gitUserId": "fastcomments",
18-
"authorizeHint": "The FastComments API uses two types of endpoints: DefaultApi which contains methods that require an API key for authentication, and PublicApi which can be accessed without authentication (often from browsers/client SDKs using SSO)."
18+
"authorizeHint": "The FastComments API uses two types of endpoints: DefaultApi requires an API key for authentication, whereas PublicApi which can be accessed without an api key (often from browsers/client SDKs using SSO)."
1919
}

0 commit comments

Comments
 (0)