Skip to content

Commit 53b2c16

Browse files
committed
add docs
1 parent 7198e34 commit 53b2c16

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,24 @@ Optional. Default: `false`.
143143
- `apiKey {Object}` — <br/>
144144
Optional. Default: `undefined`.
145145

146-
- `url {string}` — <br/>
146+
- `url {string}` — The absolute url to be requested. It's possible to use a [`pupa` template][pupa] with placeholders called `realm` and `clientId` getting rendered based on the passed options.<br/>
147+
Example: `http://barfoo.com/foo/{clientId}`<br/>
147148
Required.
148149

149-
- `in {string}` — <br/>
150+
- `in {string}` — Whether the api key is placed in the headers or query.<br/>
151+
Allowed values: `headers` & 'query'<br/>
150152
Optional. Default: `headers`.
151153

152-
- `name {string}` — <br/>
154+
- `name {string}`The name of the related headers field or query key.<br/>
153155
Optional. Default: `authorization`.
154156

155-
- `prefix {string}` — <br/>
157+
- `prefix {string}`An optional prefix of the related api key value. Mind a trailing space if necessary.<br/>
156158
Optional. Default: `Api-Key `.
157159

158-
- `tokenPath {string}` — <br/>
160+
- `tokenPath {string}`The path to the access token in the response its body as dot notation.<br/>
159161
Optional. Default: `access_token`.
160162

161-
- `options {Object}` – <br/>
163+
- `request {Object}`The detailed request options for [`got`][got].<br/>
162164
Optional. Default: `{}`
163165

164166
#### `await server.kjwt.validate(field {string})`
@@ -282,3 +284,5 @@ For further information read the [contributing guideline](CONTRIBUTING.md).
282284
[introspect]: http://www.keycloak.org/docs/2.4/authorization_services_guide/topics/service/protection/token-introspection.html
283285
[rpt]: http://www.keycloak.org/docs/2.4/authorization_services_guide/topics/service/entitlement/entitlement-api-aapi.html
284286
[rpt-terms]: http://www.keycloak.org/docs/2.4/authorization_services_guide/topics/overview/terminology.html
287+
[got]: https://github.com/sindresorhus/got
288+
[pupa]: https://github.com/sindresorhus/pupa

src/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ const scheme = joi.object({
4141
.example(['name', 'email']),
4242
apiKey: joi.object({
4343
in: joi.string().valid('headers', 'query').default('headers')
44-
.description('Whether the api key is placed in the header or query')
44+
.description('Whether the api key is placed in the headers or query')
4545
.example('query'),
4646
name: joi.string().min(1).default('authorization')
47-
.description('The name of the related header field or query key')
47+
.description('The name of the related headers field or query key')
4848
.example('x-api-key'),
4949
prefix: joi.string().min(1).default('Api-Key ')
5050
.description('An optional prefix of the related api key value')
@@ -56,7 +56,7 @@ const scheme = joi.object({
5656
.description('The detailed request options for `got`')
5757
.example({ retries: 2 }),
5858
tokenPath: joi.string().min(1).default('access_token')
59-
.description('The path to the access token in the response its body')
59+
.description('The path to the access token in the response its body as dot notation')
6060
.example('foo.bar')
6161
}).unknown(false)
6262
.description('The configuration of an optional api key strategy interaction with another service')

0 commit comments

Comments
 (0)