You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/token_authorization_api.md
+6-4
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,15 @@
1
1
# TorchServe token authorization API
2
2
3
-
Torchserve now supports token authorization by default.
3
+
TorchServe now enforces token authorization by default
4
+
4
5
5
6
## How to set and disable Token Authorization
6
7
* Global environment variable: use `TS_DISABLE_TOKEN_AUTHORIZATION` and set to `true` to disable and `false` to enable token authorization. Note that `enable_envvars_config=true` must be set in config.properties for global environment variables to be used
7
8
* Command line: Command line can only be used to disable token authorization by adding the `--disable-token` flag.
8
9
* Config properties file: use `disable_token_authorization` and set to `true` to disable and `false` to enable token authorization.
9
10
10
-
Priority between env variables, cmd, and config file follows the following [TorchServer standard](https://github.com/pytorch/serve/blob/c74a29e8144bc12b84196775076b0e8cf3c5a6fc/docs/configuration.md#advanced-configuration)
11
+
Priority between env variables, cmd, and config file follows the following [TorchServer standard](https://github.com/pytorch/serve/blob/master/docs/configuration.md)
3. API key: Used for the token authorization API. Check section 4 for API use.
51
-
4.The plugin also includes an API in order to generate a new key to replace either the management or inference key.
53
+
4. API in order to generate a new key to replace either the management or inference key.
52
54
1. Management Example:
53
55
`curl localhost:8081/token?type=management -H "Authorization: Bearer m4M-5IBY"` will replace the current management key in the key_file with a new one and will update the expiration time.
54
56
2. Inference example:
@@ -61,4 +63,4 @@ Priority between env variables, cmd, and config file follows the following [Torc
61
63
## Notes
62
64
1. DO NOT MODIFY THE KEY FILE. Modifying the key file might impact reading and writing to the file thus preventing new keys from properly being displayed in the file.
63
65
2. Time to expiration is set to default at 60 minutes but can be changed in the config.properties by adding `token_expiration_min`. Ex:`token_expiration_min=30`
64
-
3.3 tokens allow the owner with the most flexibility in use and enables them to adapt the tokens to their use. Owners of the server can provide users with the inference token if users should only be able to run inferences against models that have already been loaded. The owner can also provide owners with the management key if owners want users to add and remove models.
66
+
3.Three tokens allow the owner with the most flexibility in use and enables them to adapt the tokens to their use. Owners of the server can provide users with the inference token if users should only be able to run inferences against models that have already been loaded. The owner can also provide owners with the management key if owners want users to add and remove models.
0 commit comments