File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
ibm_cloud_sdk_core/authenticators Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 16
16
17
17
from typing import Any , Dict , Optional
18
18
19
+ from ibm_cloud_sdk_core .authenticators .iam_authenticator import IAMAuthenticator
19
20
from ibm_cloud_sdk_core .token_managers .iam_assume_token_manager import IAMAssumeTokenManager
20
21
21
22
from .authenticator import Authenticator
@@ -127,14 +128,11 @@ def validate(self) -> None:
127
128
"""
128
129
super ().validate ()
129
130
130
- if self .token_manager .iam_delegate .apikey is None :
131
- raise ValueError ('The apikey shouldn\' t be None.' )
132
-
133
- if has_bad_first_or_last_char (self .token_manager .iam_delegate .apikey ):
134
- raise ValueError (
135
- 'The apikey shouldn\' t start or end with curly brackets or quotes. '
136
- 'Please remove any surrounding {, }, or \" characters.'
137
- )
131
+ # Create a temporary IAM authenticator that we can use to validat our delegate.
132
+ tmp_authenticator = IAMAuthenticator ("" )
133
+ tmp_authenticator .token_manager = self .token_manager .iam_delegate
134
+ tmp_authenticator .validate ()
135
+ del tmp_authenticator
138
136
139
137
# Only one of the following arguments must be specified.
140
138
mutually_exclusive_attributes = [
You can’t perform that action at this time.
0 commit comments