Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion alibabacloud_credentials/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.9"
__version__ = "1.1.0"
2 changes: 1 addition & 1 deletion alibabacloud_credentials/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
URLCredentialsProvider,
DefaultCredentialsProvider)
from alibabacloud_credentials.utils import auth_constant as ac
from Tea.decorators import deprecated
from darabonba.decorators import deprecated


def attribute_error_return_none(f):
Expand Down
6 changes: 3 additions & 3 deletions alibabacloud_credentials/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import time
from urllib.parse import urlparse, parse_qs

from Tea.core import TeaCore
from darabonba.core import DaraCore

from alibabacloud_credentials.utils import auth_constant as ac
from alibabacloud_credentials.utils import parameter_helper as ph
Expand Down Expand Up @@ -362,7 +362,7 @@ def _get_new_credential(self):
for key, values in parse_qs(r.query).items():
for value in values:
tea_request.query[key] = value
response = TeaCore.do_action(tea_request)
response = DaraCore.do_action(tea_request)
if response.status_code != 200:
raise CredentialException(
"Get credentials from " + self.credentials_uri + " failed, HttpCode=" + str(response.status_code))
Expand Down Expand Up @@ -395,7 +395,7 @@ async def _get_new_credential_async(self):
tea_request.method = 'GET'
tea_request.pathname = r.path
tea_request.query = parse_qs(r.query)
response = await TeaCore.async_do_action(tea_request)
response = await DaraCore.async_do_action(tea_request)
if response.status_code != 200:
raise CredentialException(
"Get credentials from " + self.credentials_uri + " failed, HttpCode=" + str(response.status_code))
Expand Down
6 changes: 3 additions & 3 deletions alibabacloud_credentials/models.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from Tea.model import TeaModel
from darabonba.model import DaraModel


class Config(TeaModel):
class Config(DaraModel):
"""
Model for initializing credential
"""
Expand Down Expand Up @@ -230,7 +230,7 @@ def from_map(self, m: dict = None):
return self


class CredentialModel(TeaModel):
class CredentialModel(DaraModel):
def __init__(
self,
access_key_id: str = None,
Expand Down
6 changes: 3 additions & 3 deletions alibabacloud_credentials/provider/cloud_sso.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from alibabacloud_credentials.provider.refreshable import Credentials, RefreshResult, RefreshCachedSupplier
from alibabacloud_credentials.http import HttpOptions
from Tea.core import TeaCore
from darabonba.core import DaraCore
from alibabacloud_credentials_api import ICredentialsProvider
from alibabacloud_credentials.utils import parameter_helper as ph
from alibabacloud_credentials.exceptions import CredentialException
Expand Down Expand Up @@ -78,7 +78,7 @@ def _refresh_credentials(self) -> RefreshResult[Credentials]:
tea_request.headers['Content-Type'] = 'application/json'
tea_request.headers['Authorization'] = f'Bearer {self._access_token}'

response = TeaCore.do_action(tea_request, self._runtime_options)
response = DaraCore.do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(
Expand Down Expand Up @@ -126,7 +126,7 @@ async def _refresh_credentials_async(self) -> RefreshResult[Credentials]:
tea_request.headers['Content-Type'] = 'application/json'
tea_request.headers['Authorization'] = f'Bearer {self._access_token}'

response = await TeaCore.async_do_action(tea_request, self._runtime_options)
response = await DaraCore.async_do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(
Expand Down
14 changes: 7 additions & 7 deletions alibabacloud_credentials/provider/ecs_ram_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from alibabacloud_credentials.provider.refreshable import Credentials, RefreshResult, StaleValueBehavior, \
RefreshCachedSupplier, NonBlocking
from alibabacloud_credentials.http import HttpOptions
from Tea.core import TeaCore
from darabonba.core import DaraCore
from apscheduler.schedulers.background import BackgroundScheduler
from alibabacloud_credentials_api import ICredentialsProvider
from alibabacloud_credentials.utils import auth_util as au
Expand Down Expand Up @@ -90,7 +90,7 @@ def _get_role_name(self, url: str = None) -> str:
tea_request.headers['X-aliyun-ecs-metadata-token'] = metadata_token
if not url:
tea_request.pathname = self.__url_in_ecs_metadata
response = TeaCore.do_action(tea_request, self._runtime_options)
response = DaraCore.do_action(tea_request, self._runtime_options)
if response.status_code != 200:
raise CredentialException(self.__ecs_metadata_fetch_error_msg + ' HttpCode=' + str(response.status_code))
return response.body.decode('utf-8')
Expand All @@ -103,7 +103,7 @@ async def _get_role_name_async(self, url: str = None) -> str:
tea_request.headers['X-aliyun-ecs-metadata-token'] = metadata_token
if not url:
tea_request.pathname = self.__url_in_ecs_metadata
response = await TeaCore.async_do_action(tea_request, self._runtime_options)
response = await DaraCore.async_do_action(tea_request, self._runtime_options)
if response.status_code != 200:
raise CredentialException(self.__ecs_metadata_fetch_error_msg + ' HttpCode=' + str(response.status_code))
return response.body.decode('utf-8')
Expand All @@ -117,7 +117,7 @@ def _get_metadata_token(self, url: str = None) -> str:
if not url:
tea_request.pathname = self.__url_in_ecs_metadata_token
try:
response = TeaCore.do_action(tea_request, self._runtime_options)
response = DaraCore.do_action(tea_request, self._runtime_options)
if response.status_code != 200:
raise CredentialException(
self.__ecs_metadata_token_fetch_error_msg + ' HttpCode=' + str(response.status_code))
Expand All @@ -136,7 +136,7 @@ async def _get_metadata_token_async(self, url: str = None) -> str:
if not url:
tea_request.pathname = self.__url_in_ecs_metadata_token
try:
response = await TeaCore.async_do_action(tea_request, self._runtime_options)
response = await DaraCore.async_do_action(tea_request, self._runtime_options)
if response.status_code != 200:
raise CredentialException(
self.__ecs_metadata_token_fetch_error_msg + ' HttpCode=' + str(response.status_code))
Expand All @@ -158,7 +158,7 @@ def _refresh_credentials(self, url: str = None) -> RefreshResult[Credentials]:
if not url:
tea_request.pathname = self.__url_in_ecs_metadata + role_name
# request
response = TeaCore.do_action(tea_request, self._runtime_options)
response = DaraCore.do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(self.__ecs_metadata_fetch_error_msg + ' HttpCode=' + str(response.status_code))
Expand Down Expand Up @@ -202,7 +202,7 @@ async def _refresh_credentials_async(self, url: str = None) -> RefreshResult[Cre
tea_request.pathname = self.__url_in_ecs_metadata + role_name

# request
response = await TeaCore.async_do_action(tea_request, self._runtime_options)
response = await DaraCore.async_do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(self.__ecs_metadata_fetch_error_msg + ' HttpCode=' + str(response.status_code))
Expand Down
10 changes: 5 additions & 5 deletions alibabacloud_credentials/provider/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from alibabacloud_credentials.provider.refreshable import Credentials, RefreshResult, RefreshCachedSupplier
from alibabacloud_credentials.http import HttpOptions
from Tea.core import TeaCore
from darabonba.core import DaraCore
from alibabacloud_credentials_api import ICredentialsProvider
from alibabacloud_credentials.utils import parameter_helper as ph
from alibabacloud_credentials.exceptions import CredentialException
Expand Down Expand Up @@ -94,7 +94,7 @@ def _try_refresh_oauth_token(self) -> None:
tea_request.body = urlencode(body_data)
tea_request.headers['Content-Type'] = 'application/x-www-form-urlencoded'

response = TeaCore.do_action(tea_request, self._runtime_options)
response = DaraCore.do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(f"failed to refresh OAuth token, status code: {response.status_code}, response: {response.body.decode('utf-8')}")
Expand Down Expand Up @@ -135,7 +135,7 @@ async def _try_refresh_oauth_token_async(self) -> None:
tea_request.body = urlencode(body_data)
tea_request.headers['Content-Type'] = 'application/x-www-form-urlencoded'

response = await TeaCore.async_do_action(tea_request, self._runtime_options)
response = await DaraCore.async_do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(f"failed to refresh OAuth token, status code: {response.status_code}, response: {response.body.decode('utf-8')}")
Expand Down Expand Up @@ -172,7 +172,7 @@ def _refresh_credentials(self) -> RefreshResult[Credentials]:
tea_request.headers['Content-Type'] = 'application/json'
tea_request.headers['Authorization'] = f'Bearer {self._access_token}'

response = TeaCore.do_action(tea_request, self._runtime_options)
response = DaraCore.do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(
Expand Down Expand Up @@ -234,7 +234,7 @@ async def _refresh_credentials_async(self) -> RefreshResult[Credentials]:
tea_request.headers['Content-Type'] = 'application/json'
tea_request.headers['Authorization'] = f'Bearer {self._access_token}'

response = await TeaCore.async_do_action(tea_request, self._runtime_options)
response = await DaraCore.async_do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(
Expand Down
6 changes: 3 additions & 3 deletions alibabacloud_credentials/provider/oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from alibabacloud_credentials.provider.refreshable import Credentials, RefreshResult, RefreshCachedSupplier
from alibabacloud_credentials.http import HttpOptions
from Tea.core import TeaCore
from darabonba.core import DaraCore
from alibabacloud_credentials_api import ICredentialsProvider
from alibabacloud_credentials.utils import auth_util as au
from alibabacloud_credentials.utils import parameter_helper as ph
Expand Down Expand Up @@ -121,7 +121,7 @@ def _refresh_credentials(self) -> RefreshResult[Credentials]:
tea_request.protocol = 'https'
tea_request.headers['host'] = self._sts_endpoint

response = TeaCore.do_action(tea_request, self._runtime_options)
response = DaraCore.do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(
Expand Down Expand Up @@ -172,7 +172,7 @@ async def _refresh_credentials_async(self) -> RefreshResult[Credentials]:
tea_request.protocol = 'https'
tea_request.headers['host'] = self._sts_endpoint

response = await TeaCore.async_do_action(tea_request, self._runtime_options)
response = await DaraCore.async_do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(
Expand Down
6 changes: 3 additions & 3 deletions alibabacloud_credentials/provider/ram_role_arn.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from alibabacloud_credentials.provider.refreshable import Credentials, RefreshResult, RefreshCachedSupplier
from alibabacloud_credentials.provider import StaticAKCredentialsProvider, StaticSTSCredentialsProvider
from alibabacloud_credentials.http import HttpOptions
from Tea.core import TeaCore
from darabonba.core import DaraCore
from alibabacloud_credentials_api import ICredentialsProvider
from alibabacloud_credentials.utils import auth_util as au
from alibabacloud_credentials.utils import parameter_helper as ph
Expand Down Expand Up @@ -134,7 +134,7 @@ def _refresh_credentials(self) -> RefreshResult[Credentials]:
tea_request.protocol = 'https'
tea_request.headers['host'] = self._sts_endpoint

response = TeaCore.do_action(tea_request, self._runtime_options)
response = DaraCore.do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(
Expand Down Expand Up @@ -200,7 +200,7 @@ async def _refresh_credentials_async(self) -> RefreshResult[Credentials]:
tea_request.protocol = 'https'
tea_request.headers['host'] = self._sts_endpoint

response = await TeaCore.async_do_action(tea_request, self._runtime_options)
response = await DaraCore.async_do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(
Expand Down
6 changes: 3 additions & 3 deletions alibabacloud_credentials/provider/rsa_key_pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from alibabacloud_credentials.provider.refreshable import Credentials, RefreshResult, RefreshCachedSupplier
from alibabacloud_credentials.http import HttpOptions
from Tea.core import TeaCore
from darabonba.core import DaraCore
from alibabacloud_credentials_api import ICredentialsProvider
from alibabacloud_credentials.utils import auth_util as au
from alibabacloud_credentials.utils import parameter_helper as ph
Expand Down Expand Up @@ -104,7 +104,7 @@ def _refresh_credentials(self) -> RefreshResult[Credentials]:
tea_request.protocol = 'https'
tea_request.headers['host'] = self._sts_endpoint

response = TeaCore.do_action(tea_request, self._runtime_options)
response = DaraCore.do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(
Expand Down Expand Up @@ -153,7 +153,7 @@ async def _refresh_credentials_async(self) -> RefreshResult[Credentials]:
tea_request.protocol = 'https'
tea_request.headers['host'] = self._sts_endpoint

response = await TeaCore.async_do_action(tea_request, self._runtime_options)
response = await DaraCore.async_do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(
Expand Down
6 changes: 3 additions & 3 deletions alibabacloud_credentials/provider/uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from alibabacloud_credentials.provider.refreshable import Credentials, RefreshResult, RefreshCachedSupplier
from alibabacloud_credentials.http import HttpOptions
from Tea.core import TeaCore
from darabonba.core import DaraCore
from alibabacloud_credentials_api import ICredentialsProvider
from alibabacloud_credentials.utils import auth_util as au
from alibabacloud_credentials.utils import parameter_helper as ph
Expand Down Expand Up @@ -61,7 +61,7 @@ def _refresh_credentials(self) -> RefreshResult[Credentials]:
for value in values:
tea_request.query[key] = value

response = TeaCore.do_action(tea_request, self._runtime_options)
response = DaraCore.do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(
Expand Down Expand Up @@ -102,7 +102,7 @@ async def _refresh_credentials_async(self) -> RefreshResult[Credentials]:
for value in values:
tea_request.query[key] = value

response = await TeaCore.async_do_action(tea_request, self._runtime_options)
response = await DaraCore.async_do_action(tea_request, self._runtime_options)

if response.status_code != 200:
raise CredentialException(
Expand Down
Loading
Loading