MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / _get_k8s_token

Function _get_k8s_token

pymongo/auth_oidc_shared.py:126–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124
125
126def _get_k8s_token() -> str:
127 fname = "/var/run/secrets/kubernetes.io/serviceaccount/token"
128 for key in ["AZURE_FEDERATED_TOKEN_FILE", "AWS_WEB_IDENTITY_TOKEN_FILE"]:
129 if key in os.environ:
130 fname = os.environ[key]
131 with open(fname) as fid:
132 return fid.read()

Callers 3

get_tokenMethod · 0.90
get_tokenMethod · 0.90
fetchMethod · 0.85

Calls 1

readMethod · 0.45

Tested by 2

get_tokenMethod · 0.72
get_tokenMethod · 0.72