rs_server_common/authentication/apikey.md
API key authentication functions implementation.
Note: calls https://github.com/csgroup-oss/apikey-manager
__apikey_security_cached(apikey_value)
async
Cached version of apikey_security. Cache an infinite (sys.maxsize) number of results for 120 seconds.
This function serves as a cached version of apikey_security. It retrieves user access control information from the User Authentication and Authorization Control (UAC) manager and caches the result for performance optimization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
apikey_value
|
str
|
The API key value. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
AuthInfo |
AuthInfo
|
Authentication information from the keycloak account, associated to the api key. |
Raises:
| Type | Description |
|---|---|
HTTPException
|
If there is an error connecting to the UAC manager or if the UAC manager returns an error. |
Source code in docs/rs-server/services/common/rs_server_common/authentication/apikey.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
apikey_security(apikey_value='')
async
Check the api key validity, passed as an HTTP header.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
apikey_value
|
Security
|
API key passed in HTTP header |
''
|
Returns:
| Type | Description |
|---|---|
AuthInfo | None
|
Authentication information from the keycloak account, associated to the api key. |
AuthInfo | None
|
Or None if no api key is provided. |
Source code in docs/rs-server/services/common/rs_server_common/authentication/apikey.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |