Skip to content

Commit b274cc6

Browse files
committed
chore(auth type): Case insensitive for auth type
1 parent f1f4986 commit b274cc6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ibm_cloud_sdk_core/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@ def read_from_vcap_services(service_name):
151151
return vcap_service_credentials
152152

153153
def contruct_authenticator(config):
154-
auth_type = config.get('auth_type') if config.get('auth_type') else 'iam'
154+
auth_type = config.get('auth_type').lower() if config.get('auth_type') else 'iam'
155155
authenticator = None
156156
from .authenticators import BasicAuthenticator, BearerTokenAuthenticator, CloudPakForDataAuthenticator, IAMAuthenticator, NoAuthAuthenticator
157157

158158
if auth_type == 'basic':
159159
authenticator = BasicAuthenticator(
160160
username=config.get('username'),
161161
password=config.get('password'))
162-
elif auth_type == 'bearerToken':
162+
elif auth_type == 'bearertoken':
163163
authenticator = BearerTokenAuthenticator(
164164
bearer_token=config.get('bearer_token'))
165165
elif auth_type == 'cp4d':
@@ -175,7 +175,7 @@ def contruct_authenticator(config):
175175
client_id=config.get('client_id'),
176176
client_secret=config.get('client_secret'),
177177
disable_ssl_verification=config.get('auth_disable_ssl'))
178-
elif auth_type == 'noAuth':
178+
elif auth_type == 'noauth':
179179
authenticator = NoAuthAuthenticator()
180180

181181
return authenticator

0 commit comments

Comments
 (0)