Skip to content

Commit dd1a1f9

Browse files
authored
Merge pull request #330 from watson-developer-cloud/5980-load-credentials-from-file
Load credentials from file
2 parents 7df3738 + 3a0dfb2 commit dd1a1f9

File tree

30 files changed

+1447
-1117
lines changed

30 files changed

+1447
-1117
lines changed

.secrets.baseline

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"exclude_regex": null,
3-
"generated_at": "2019-01-16T21:58:27Z",
3+
"generated_at": "2019-01-31T23:42:02Z",
44
"plugins_used": [
55
{
66
"base64_limit": 4.5,
@@ -55,13 +55,13 @@
5555
{
5656
"hashed_secret": "c51238bc51c3b0abee7f61d90c414aec89009734",
5757
"is_secret": false,
58-
"line_number": 48,
58+
"line_number": 49,
5959
"type": "Basic Auth Credentials"
6060
},
6161
{
6262
"hashed_secret": "3f820839b94508b2a9dc3b3e6e1149080af8780c",
6363
"is_secret": false,
64-
"line_number": 83,
64+
"line_number": 84,
6565
"type": "Basic Auth Credentials"
6666
}
6767
]

IBM.WatsonDeveloperCloud.sln

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.Co
127127
EndProject
128128
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.CompareComply.v1.IT", "test\IBM.WatsonDeveloperCloud.CompareComply.v1.IT\IBM.WatsonDeveloperCloud.CompareComply.v1.IT.csproj", "{42258A9B-CE18-4C39-BAA5-19F8C5DE041B}"
129129
EndProject
130-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBM.WatsonDeveloperCloud.CompareComply.v1.UT", "test\IBM.WatsonDeveloperCloud.CompareComply.v1.UT\IBM.WatsonDeveloperCloud.CompareComply.v1.UT.csproj", "{DF7A03F2-66F3-4B70-8311-A3487553CA0C}"
130+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.CompareComply.v1.UT", "test\IBM.WatsonDeveloperCloud.CompareComply.v1.UT\IBM.WatsonDeveloperCloud.CompareComply.v1.UT.csproj", "{DF7A03F2-66F3-4B70-8311-A3487553CA0C}"
131+
EndProject
132+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IBM.WatsonDeveloperCloud.Core.IntegrationTests", "test\IBM.WatsonDeveloperCloud.Core.IntegrationTests\IBM.WatsonDeveloperCloud.Core.IntegrationTests.csproj", "{03A84C2E-8285-483E-8BD2-4A367DDFF230}"
131133
EndProject
132134
Global
133135
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -319,6 +321,10 @@ Global
319321
{DF7A03F2-66F3-4B70-8311-A3487553CA0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
320322
{DF7A03F2-66F3-4B70-8311-A3487553CA0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
321323
{DF7A03F2-66F3-4B70-8311-A3487553CA0C}.Release|Any CPU.Build.0 = Release|Any CPU
324+
{03A84C2E-8285-483E-8BD2-4A367DDFF230}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
325+
{03A84C2E-8285-483E-8BD2-4A367DDFF230}.Debug|Any CPU.Build.0 = Debug|Any CPU
326+
{03A84C2E-8285-483E-8BD2-4A367DDFF230}.Release|Any CPU.ActiveCfg = Release|Any CPU
327+
{03A84C2E-8285-483E-8BD2-4A367DDFF230}.Release|Any CPU.Build.0 = Release|Any CPU
322328
EndGlobalSection
323329
GlobalSection(SolutionProperties) = preSolution
324330
HideSolutionNode = FALSE
@@ -385,6 +391,7 @@ Global
385391
{0287B6FD-D28A-47C9-9686-C4658EBD2129} = {B368DCF7-FB57-4302-8467-4EB142394A29}
386392
{42258A9B-CE18-4C39-BAA5-19F8C5DE041B} = {B368DCF7-FB57-4302-8467-4EB142394A29}
387393
{DF7A03F2-66F3-4B70-8311-A3487553CA0C} = {B368DCF7-FB57-4302-8467-4EB142394A29}
394+
{03A84C2E-8285-483E-8BD2-4A367DDFF230} = {FF4673C9-CB33-4D4F-9116-776A792A2189}
388395
EndGlobalSection
389396
GlobalSection(ExtensibilityGlobals) = postSolution
390397
SolutionGuid = {B9D9D17B-1C17-402F-B701-DC671528690A}

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,25 @@ void Example()
101101
}
102102
```
103103

104+
### ibm-credentials.env
105+
You can create an ibm-credentials.env file for authentication. This has the basic format
106+
```
107+
VISUAL_RECOGNITION_APIKEY=<visual-recognition-apikey>
108+
VISUAL_RECOGNITION_URL=<visual-recognition-service-url>
109+
ASSISTANT_APIKEY=<assistant-apikey>
110+
ASSISTANT_URL=<assistant-service-url>
111+
```
112+
The SDK will search for this file in the following order
113+
- Path specified by environmental variable `IBM_CREDENTIALS_FILE`
114+
- System home directory
115+
- Top level of the project directory
116+
117+
Using a `ibm-credentials.env` file you can easily instantiate and authenticate a service.
118+
```
119+
AssistantService assistantService = new AssistantService();
120+
var listWorkspacesResult = assistantService.ListWorkspaces();
121+
```
122+
104123
## Custom Request Headers
105124
You can send custom request headers by adding them to the `customData` object.
106125
```cs

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ environment:
1717
secure: gevsMhy8RTWMdf7MjOnIo5QaN6JpL9DPK6I+Go5ByZir5LDwyFsv9hO6nBjGTg8n
1818
GITHUB_TOKEN:
1919
secure: +B2bs86RVtJtlbkB+cTf9bkqnNlFJi/PbBBPzR5jlUlLLZoOc+ZgqgQLwee4tCT+
20+
IBM_CREDENTIALS_FILE: C:\projects\sdk-credentials\ibm-credentials.env
2021
install:
2122
# Get the latest stable version of Node.js or io.js
2223
- ps: Install-Product node $env:nodejs_version

0 commit comments

Comments
 (0)