Skip to content

Commit

Permalink
Merge pull request #2424 from kuzzleio/2.20.0-proposal
Browse files Browse the repository at this point in the history
# [2.20.0](https://github.com/kuzzleio/kuzzle/releases/tag/2.20.0) (2023-01-17)


#### New features

- [ [#2423](#2423) ] Add action to generate single use token   ([Aschen](https://github.com/Aschen))

#### Enhancements

- [ [#2413](#2413) ] Bump segfault handler to 1.4.2   ([Shiranuit](https://github.com/Shiranuit))
- [ [#2415](#2415) ] Add Inflector.snakeCase method   ([Aschen](https://github.com/Aschen))
---
  • Loading branch information
Aschen authored Jan 18, 2023
2 parents 8eef933 + 216f411 commit d3b2cb1
Show file tree
Hide file tree
Showing 659 changed files with 1,876 additions and 1,844 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ lib/types/Global.d.ts
lib/types/Global.js
lib/util/interfaces.js
lib/util/mutex.js
lib/util/inflector.js
lib/util/Inflector.js
lib/util/koncordeCompat.js
lib/util/name-generator.js
features/support/application/functional-tests-app.js
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ lib/util/array.js
lib/util/bufferedPassThrough.js
lib/util/crypto.js
lib/util/dump-collection.js
lib/util/inflector.js
lib/util/Inflector.js
lib/util/interfaces.js
lib/util/koncordeCompat.js
lib/util/mutex.js
Expand Down
2 changes: 1 addition & 1 deletion doc/2/.vuepress
2 changes: 1 addition & 1 deletion doc/2/api/controllers/admin/dump/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: dump
title: dump | API | Core
---

# dump
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/admin/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
type: branch
title: admin
title: admin | API | Core
description: API v2.x Admin controller
code: true
---
2 changes: 1 addition & 1 deletion doc/2/api/controllers/admin/load-fixtures/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: loadFixtures
title: loadFixtures | API | Core
---

# loadFixtures
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/admin/load-mappings/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: loadMappings
title: loadMappings | API | Core
---

# loadMappings
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/admin/load-securities/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: loadSecurities
title: loadSecurities | API | Core
---

# loadSecurities
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/admin/reset-cache/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type: page

code: true
title: resetCache
title: resetCache | API | Core
---

# resetCache
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/admin/reset-database/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type: page

code: true
title: resetDatabase
title: resetDatabase | API | Core
---

# resetDatabase
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/admin/reset-security/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type: page

code: true
title: resetSecurity
title: resetSecurity | API | Core
---

# resetSecurity
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/admin/shutdown/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type: page

code: true
title: shutdown
title: shutdown | API | Core
---

# shutdown
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/check-rights/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: checkRights
title: checkRights | API | Core
---

# checkRights
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/check-token/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: checkToken
title: checkToken | API | Core
---

# checkToken
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/create-api-key/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: createApiKey
title: createApiKey | API | Core
---

# createApiKey
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/create-my-credentials/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: createMyCredentials
title: createMyCredentials | API | Core
---

# createMyCredentials
Expand Down
89 changes: 89 additions & 0 deletions doc/2/api/controllers/auth/create-token/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
code: true
type: page
title: createToken | API | Core
---

# createToken

<SinceBadge version="2.20.0"/>

Creates a token for the currently loggued user.

::: info
It is not possible to create token that does not expire to prevent memory leaks.
For this you should use [auth:createApiKey](/core/2/api/controllers/auth/create-api-key) instead.
:::

---

## Query Syntax

### HTTP

```http
URL: http://kuzzle:7512/_createToken[&expiresIn=900][&singleUse]
Method: POST
Body:
```

```js
{
}
```

### Other protocols

```js
{
"controller": "auth",
"action": "createToken",


// optional arguments
"singleUse": true,
"expiresIn": 900
}
```

---

## Arguments

### Optional

- `expiresIn`: set the expiration duration (`-1` by default)
- if a raw number is provided (not enclosed between quotes), then the expiration delay is in milliseconds. Example: `86400000`
- if this value is a string, then its content is parsed by the [ms](https://www.npmjs.com/package/ms) library. Examples: `"6d"`, `"10h"`
- `singleUse`: if set to `true`, then the token can be used only once

---

## Body properties

---

## Response

Returns an object containing the token:

- `expiresAt`: expiration date in UNIX micro-timestamp format
- `ttl`: original ttl
- `token`: authentication token associated with this API key
- `singleUse`: `true` if single use token

```js
{
"status": 200,
"error": null,
"controller": "auth",
"action": "createToken",
"requestId": "<unique request identifier>",
"result": {
"expiresAt": -1,
"ttl": -1,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiJNeSIsImlhdCI6MTU3MzE4NTkzNSwiZXhwIjoxNTczMTg1OTM0fQ.08qAnSD03V0N1OcviGVUAZEjjv4DxULTgoQQwojn1PA",
"singleUse": true,
}
}
```
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/credentials-exists/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: credentialsExist
title: credentialsExist | API | Core
---

# credentialsExist
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/delete-api-key/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: deleteApiKey
title: deleteApiKey | API | Core
---

# deleteApiKey
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/delete-my-credentials/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: deleteMyCredentials
title: deleteMyCredentials | API | Core
---

# deleteMyCredentials
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/get-current-user/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: getCurrentUser
title: getCurrentUser | API | Core
---

# getCurrentUser
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/get-my-credentials/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: getMyCredentials
title: getMyCredentials | API | Core
---

# getMyCredentials
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/get-my-rights/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: getMyRights
title: getMyRights | API | Core
---

# getMyRights
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/get-strategies/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: getStrategies
title: getStrategies | API | Core
---

# getStrategies
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
type: branch
code: true
title: auth
title: auth | API | Core
---
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/login/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: login
title: login | API | Core
---

# login
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/logout/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: logout
title: logout | API | Core
---

# logout
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/refresh-token/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: refreshToken
title: refreshToken | API | Core
---

# refreshToken
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/search-api-keys/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: searchApiKeys
title: searchApiKeys | API | Core
---

# searchApiKeys
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/update-my-credentials/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: updateMyCredentials
title: updateMyCredentials | API | Core
---

# updateMyCredentials
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/auth/update-self/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: updateSelf
title: updateSelf | API | Core
---

# updateSelf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: validateMyCredentials
title: validateMyCredentials | API | Core
---

# validateMyCredentials
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/bulk/delete-by-query/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: deleteByQuery
title: deleteByQuery | API | Core
---

# deleteByQuery
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/bulk/import/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: import
title: import | API | Core
---

# import
Expand Down
2 changes: 1 addition & 1 deletion doc/2/api/controllers/bulk/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
type: branch
code: true
title: bulk
title: bulk | API | Core
---
2 changes: 1 addition & 1 deletion doc/2/api/controllers/bulk/m-write/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
code: true
type: page
title: mWrite
title: mWrite | API | Core
---

# mWrite
Expand Down
Loading

0 comments on commit d3b2cb1

Please sign in to comment.