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: source/auth/auth.rst
+13-2
Original file line number
Diff line number
Diff line change
@@ -984,7 +984,16 @@ request. If so, then in addition to a username and password, users MAY also prov
984
984
985
985
Environment variables
986
986
_____________________
987
-
AWS Lambda runtimes set several `environment variables <https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime>`_ during initialization. To support AWS Lambda runtimes Drivers MUST check a subset of these variables, i.e., ``AWS_ACCESS_KEY_ID``, ``AWS_SECRET_ACCESS_KEY``, and ``AWS_SESSION_TOKEN``, for the access key ID, secret access key and session token, respectively if AWS credentials are not explicitly provided in the URI. The ``AWS_SESSION_TOKEN`` may or may not be set. However, if ``AWS_SESSION_TOKEN`` is set Drivers MUST use its value as the session token.
987
+
AWS Lambda runtimes set several `environment variables <https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime>`_ during initialization. To support AWS Lambda runtimes Drivers MUST check a subset of these variables, i.e., ``AWS_ACCESS_KEY_ID``, ``AWS_SECRET_ACCESS_KEY``, and ``AWS_SESSION_TOKEN``, for the access key ID, secret access key and session token, respectively if AWS credentials are not explicitly provided in the URI. The ``AWS_SESSION_TOKEN`` may or may not be set. However, if ``AWS_SESSION_TOKEN`` is set Drivers MUST use its value as the session token. Drivers implemented
988
+
in programming languages that support altering environment variables MUST always
989
+
read environment variables dynamically during authorization, to handle the
990
+
case where another part the application has refreshed the credentials.
991
+
992
+
However, if environment variables are not present during initial authorization,
993
+
credentials may be fetched from another source and cached. Even if the
994
+
environmnet variables are present in subsequent authorization attempts,
995
+
the driver MUST use the cached credentials, or refresh them if applicable.
996
+
This behavior is consistent with how the AWS SDKs behave.
988
997
989
998
AssumeRoleWithWebIdentity
990
999
_________________________
@@ -1137,7 +1146,8 @@ be used in lieu of manual caching.
1137
1146
If using manual caching, the "Expiration" field MUST be stored
1138
1147
and used to determine when to clear the cache. Credentials are considered
1139
1148
valid if they are more than five minutes away from expiring; to the reduce the
1140
-
chance of expiration before they are validated by the server.
1149
+
chance of expiration before they are validated by the server. Credentials
1150
+
that are retreived from environment variables MUST NOT be cached.
1141
1151
1142
1152
If there are no current valid cached credentials, the driver MUST initiate a
1143
1153
credential request. To avoid adding a bottleneck that would override the
@@ -1385,6 +1395,7 @@ Q: Should drivers support accessing Amazon EC2 instance metadata in Amazon ECS?
1385
1395
Changelog
1386
1396
=========
1387
1397
1398
+
:2022-11-02: Require environment variables to be read dynamically.
1388
1399
:2022-10-28: Recommend the use of AWS SDKs where available.
1389
1400
:2022-10-07: Require caching of AWS credentials fetched by the driver.
1390
1401
:2022-10-05: Remove spec front matter and convert version history to changelog.
0 commit comments