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: Scripts/Utilities/Credentials.cs
+67-4Lines changed: 67 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,9 @@ public class Credentials
36
36
privateIamTokenData_iamTokenData;
37
37
privatestring_iamApiKey;
38
38
privatestring_userAcessToken;
39
+
privatestringurl;
40
+
privatestringusername;
41
+
privatestringpassword;
39
42
privateconststringAPIKEY_AS_USERNAME="apikey";
40
43
privateconststringICP_PREFIX="icp-";
41
44
#endregion
@@ -44,11 +47,39 @@ public class Credentials
44
47
/// <summary>
45
48
/// The user name.
46
49
/// </summary>
47
-
publicstringUsername{get;set;}
50
+
publicstringUsername
51
+
{
52
+
get{returnusername;}
53
+
set
54
+
{
55
+
if(!Utility.HasBadFirstOrLastCharacter(value))
56
+
{
57
+
username=value;
58
+
}
59
+
else
60
+
{
61
+
thrownewWatsonException("The username shouldn't start or end with curly brackets or quotes. Be sure to remove any {} and \" characters surrounding your username.");
62
+
}
63
+
}
64
+
}
48
65
/// <summary>
49
66
/// The password.
50
67
/// </summary>
51
-
publicstringPassword{get;set;}
68
+
publicstringPassword
69
+
{
70
+
get{returnpassword;}
71
+
set
72
+
{
73
+
if(!Utility.HasBadFirstOrLastCharacter(value))
74
+
{
75
+
password=value;
76
+
}
77
+
else
78
+
{
79
+
thrownewWatsonException("The password shouldn't start or end with curly brackets or quotes. Be sure to remove any {} and \" characters surrounding your password.");
80
+
}
81
+
}
82
+
}
52
83
/// <summary>
53
84
/// The Api Key.
54
85
/// </summary>
@@ -65,7 +96,21 @@ public string WatsonAuthenticationToken
65
96
/// <summary>
66
97
/// The service endpoint.
67
98
/// </summary>
68
-
publicstringUrl{get;set;}
99
+
publicstringUrl
100
+
{
101
+
get{returnurl;}
102
+
set
103
+
{
104
+
if(!Utility.HasBadFirstOrLastCharacter(value))
105
+
{
106
+
url=value;
107
+
}
108
+
else
109
+
{
110
+
thrownewWatsonException("The service URL shouldn't start or end with curly brackets or quotes. Be sure to remove any {} and \" characters surrounding your service url.");
111
+
}
112
+
}
113
+
}
69
114
70
115
/// <summary>
71
116
/// The IAM access token.
@@ -645,8 +690,26 @@ public class Credential
645
690
[fsObject]
646
691
publicclassTokenOptions
647
692
{
693
+
privatestringiamApiKey;
648
694
[fsProperty("iamApiKey")]
649
-
publicstringIamApiKey{get;set;}
695
+
publicstringIamApiKey
696
+
{
697
+
get
698
+
{
699
+
returniamApiKey;
700
+
}
701
+
set
702
+
{
703
+
if(!Utility.HasBadFirstOrLastCharacter(value))
704
+
{
705
+
iamApiKey=value;
706
+
}
707
+
else
708
+
{
709
+
thrownewWatsonException("The credentials shouldn't start or end with curly brackets or quotes. Be sure to remove any {} and \" characters surrounding your credentials");
0 commit comments