Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
66643ab
Merge pull request #416 from watson-developer-cloud/rc-2.4.1
mediumTaj Jun 29, 2018
98ee891
Add target to tracking query param
mediumTaj Jun 29, 2018
a757b44
Update README.md
mediumTaj Jun 29, 2018
c35a73f
Update README.md
mediumTaj Jul 6, 2018
223d2d7
docs(notices): add notices file
mediumTaj Jul 11, 2018
c6a4c40
feat(cf-token): Added deprecation message when using Watson Token
mediumTaj Jul 11, 2018
19a962c
docs(README): Added deprecation notice for CF authentication tokens
mediumTaj Jul 11, 2018
1dc3085
perf(basicauth-apikey): Use token if attempting to authenticate with …
mediumTaj Jul 11, 2018
cf1d824
test(basicauth-apikey): Add language Translator v3 tests using IAM Ap…
mediumTaj Jul 11, 2018
8b249a6
feat(datamodel): Add datamodels for Credentials operations
mediumTaj Jul 11, 2018
d6534e2
refactor(datamodel): Update enums in datamodel
mediumTaj Jul 11, 2018
d4c7a29
refactor: autoformat Discovery.cs
mediumTaj Jul 11, 2018
40e2e3c
feat(discovery): abstract Credentials operations
mediumTaj Jul 11, 2018
74afbeb
feat(examples): add examples for new Discovery Credentials endpoints
mediumTaj Jul 11, 2018
a539d72
test(discovery): add integration tests for Credentials endpoints
mediumTaj Jul 12, 2018
acc8d90
Merge pull request #420 from watson-developer-cloud/feature-add-notices
mediumTaj Jul 12, 2018
081db74
Merge branch 'develop' into 4993-deprecate-cf-tokens
mediumTaj Jul 12, 2018
a8bd39e
Merge pull request #421 from watson-developer-cloud/4993-deprecate-cf…
mediumTaj Jul 12, 2018
6fc6bf8
Merge branch 'develop' into 4956-iam-token-apikey-basicauth
mamoonraja Jul 12, 2018
82dd5c4
Merge branch 'develop' into 4933-abstract-discovery-endpoints
mamoonraja Jul 12, 2018
0287120
Merge pull request #422 from watson-developer-cloud/4956-iam-token-ap…
mediumTaj Jul 12, 2018
6151d7b
Merge branch 'develop' into 4933-abstract-discovery-endpoints
mediumTaj Jul 12, 2018
5a97842
refactor(examples):autoformat discovery examples
mediumTaj Jul 12, 2018
9d8eb04
refactor(tests): autoformat discovery tests
mediumTaj Jul 12, 2018
46d1cd1
Merge branch '4933-abstract-discovery-endpoints' of github.com:watson…
mediumTaj Jul 12, 2018
7c861a3
Merge pull request #423 from watson-developer-cloud/4933-abstract-dis…
mediumTaj Jul 12, 2018
6b8be82
refactor: Change SDK name
mediumTaj Jul 12, 2018
d3a2797
refactor: bump version
mediumTaj Jul 12, 2018
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 Docs/publishing-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following tasks should be completed before publishing a release. Track the p
- [ ] Review and merge any outstanding pull requests.
- [ ] Review any oustanding issues assigned to this release milestone.
- [ ] Branch from `develop` to `rc-[version]`, ex: `rc-2.0.0`.
- [ ] Draft release with version in the format of `v2.0.0` targeting the 'master' branch. Standard release should be named using the format `Watson Developer Cloud Unity SDK [version]`, ex: `Watson Developer Cloud Unity SDK v2.0.0`.
- [ ] Draft release with version in the format of `v2.0.0` targeting the 'master' branch. Standard release should be named using the format `IBM Watson SDK for Unity [version]`, ex: `IBM Watson SDK for Unity v2.0.0`.

#### Source Changes (in `rc` branch)
- [ ] Update `String.Version` in `Scripts/Utilities/Constants.cs` to the current version, ex: `watson-apis-unity-sdk/2.0.0`
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "Watson Developer Cloud Unity SDK"
PROJECT_NAME = "IBM Watson SDK for Unity"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand Down
79 changes: 78 additions & 1 deletion Examples/ServiceExamples/Scripts/ExampleDiscovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ public class ExampleDiscovery : MonoBehaviour
private bool _readyToContinue = false;
private float _waitTime = 10f;

private bool _listCredentialsTested = false;
private bool _createCredentialsTested = false;
private bool _getCredentialTested = false;
private bool _deleteCredentialsTested = false;
private string _createdCredentialId = null;

private void Start()
{
LogSystem.InstallDefaultReactors();
Expand Down Expand Up @@ -285,6 +291,44 @@ private IEnumerator Examples()
while (!_isEnvironmentReady)
yield return null;

// List Credentials
Log.Debug("TestDiscovery.RunTest()", "Attempting to list credentials");
_service.ListCredentials(OnListCredentials, OnFail, _environmentId);
while (!_listCredentialsTested)
yield return null;

// Create Credentials
Log.Debug("TestDiscovery.RunTest()", "Attempting to create credentials");
SourceCredentials credentialsParameter = new SourceCredentials()
{
SourceType = SourceCredentials.SourceTypeEnum.box,
CredentialDetails = new CredentialDetails()
{
CredentialType = CredentialDetails.CredentialTypeEnum.oauth2,
EnterpriseId = "myEnterpriseId",
ClientId = "myClientId",
ClientSecret = "myClientSecret",
PublicKeyId = "myPublicIdKey",
Passphrase = "myPassphrase",
PrivateKey = "myPrivateKey"
}
};
_service.CreateCredentials(OnCreateCredentials, OnFail, _environmentId, credentialsParameter);
while (!_createCredentialsTested)
yield return null;

// Get Credential
Log.Debug("TestDiscovery.RunTest()", "Attempting to get credential");
_service.GetCredential(OnGetCredential, OnFail, _environmentId, _createdCredentialId);
while (!_getCredentialTested)
yield return null;

// DeleteCredential
Log.Debug("TestDiscovery.RunTest()", "Attempting to delete credential");
_service.DeleteCredentials(OnDeleteCredentials, OnFail, _environmentId, _createdCredentialId);
while (!_deleteCredentialsTested)
yield return null;

Log.Debug("TestDiscovery.RunTest()", "Discovery examples complete.");
}

Expand Down Expand Up @@ -327,13 +371,22 @@ private IEnumerator Delay(float waitTime)
private void OnGetEnvironments(GetEnvironmentsResponse resp, Dictionary<string, object> customData)
{
Log.Debug("ExampleDiscovery.OnGetEnvironments()", "Discovery - GetEnvironments Response: {0}", customData["json"].ToString());

foreach (var environment in resp.environments)
{
if (environment.read_only == false)
{
Log.Debug("ExampleDiscovery.OnGetEnvironments()", "setting environment to {0}", environment.environment_id);
_environmentId = environment.environment_id;
}
}

_getEnvironmentsTested = true;
}

private void OnGetEnvironment(Environment resp, Dictionary<string, object> customData)
{
Log.Debug("ExampleDiscovery.OnGetEnvironment()", "Discovery - GetEnvironment Response: {0}", customData["json"].ToString());
_environmentId = resp.environment_id;
_getEnvironmentTested = true;
}

Expand Down Expand Up @@ -437,6 +490,30 @@ private void OnQuery(QueryResponse resp, Dictionary<string, object> customData)
_queryTested = true;
}

private void OnListCredentials(CredentialsList response, Dictionary<string, object> customData)
{
Log.Debug("ExampleDiscovery.OnListCredentials()", "Response: {0}", customData["json"].ToString());
_listCredentialsTested = true;
}
private void OnCreateCredentials(SourceCredentials response, Dictionary<string, object> customData)
{
Log.Debug("ExampleDiscovery.OnCreateCredentials()", "Response: {0}", customData["json"].ToString());
_createdCredentialId = response.CredentialId;
_createCredentialsTested = true;
}

private void OnGetCredential(SourceCredentials response, Dictionary<string, object> customData)
{
Log.Debug("ExampleDiscovery.OnGetCredential()", "Response: {0}", customData["json"].ToString());
_getCredentialTested = true;
}

private void OnDeleteCredentials(DeleteCredentials response, Dictionary<string, object> customData)
{
Log.Debug("ExampleDiscovery.OnDeleteCredentials()", "Response: {0}", customData["json"].ToString());
_deleteCredentialsTested = true;
}

private void OnFail(RESTConnector.Error error, Dictionary<string, object> customData)
{
Log.Error("ExampleDiscovery.OnFail()", "Error received: {0}", error.ToString());
Expand Down
79 changes: 79 additions & 0 deletions NOTICES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
This asset is governed by the Asset Store EULA; however, the following components are governed by the licenses indicated below:

A. websocket-sharp

The MIT License (MIT)

Copyright (c) 2010-2018 sta.blockhead

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


B. Full Serializer

The MIT License (MIT)

Copyright (c) 2014 Jacob Dufault

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

C. MiniJSON

Copyright (c) 2013 Calvin Rien

Based on the JSON parser by Patrick van Bergen
http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html

Simplified it so that it doesn't throw exceptions
and can be used in Unity iPhone with maximum code stripping.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Ensure that you have the following prerequisites:
* [Unity][get_unity]. You can use the **free** Personal edition.

## Configuring Unity
* Change the build settings in Unity (**File > Build Settings**) to any platform except for web player/Web GL. The Watson Developer Cloud Unity SDK does not support Unity Web Player.
* Change the build settings in Unity (**File > Build Settings**) to any platform except for web player/Web GL. The IBM Watson SDK for Unity does not support Unity Web Player.
* If using Unity 2018.2 or later you'll need to set Scripting Runtime Version in Build Settings to .NET 4.x equivalent. We need to access security options to enable TLS 1.2.

## Getting the Watson SDK and adding it to Unity
Expand Down Expand Up @@ -107,15 +107,16 @@ You supply either an IAM service **API key** or an **access token**:
```cs
IEnumerator TokenExample()
{
// Create IAM token options and supply the apikey.
// Create IAM token options and supply the apikey. IamUrl is the URL used to get the
// authorization token using the IamApiKey. It defaults to https://iam.bluemix.net/identity/token
TokenOptions iamTokenOptions = new TokenOptions()
{
IamApiKey = "<iam-api-key>",
IamUrl = "<service-url>"
IamUrl = "<iam-url>"
};

// Create credentials using the IAM token options
_credentials = new Credentials(iamTokenOptions, "<service-url");
_credentials = new Credentials(iamTokenOptions, "<service-url>");
while (!_credentials.HasIamTokenData())
yield return null;

Expand Down Expand Up @@ -314,6 +315,9 @@ private void OnMessage(object resp, Dictionary<string, object> customData)
```

## Authentication Tokens

**Authenticating with the `X-Watson-Authorization-Token` header is deprecated. The token continues to work with Cloud Foundry services, but is not supported for services that use Identity and Access Management (IAM) authentication. For details see [Authenticating with IAM tokens](https://console.bluemix.net/docs/services/watson/getting-started-iam.html#iam) or the [README](#IAM) in the IBM Watson SDK you use.**

You use tokens to write applications that make authenticated requests to IBM Watson™ services without embedding service credentials in every call.

You can write an authentication proxy in IBM Cloud that obtains and returns a token to your client application, which can then use the token to call the service directly. This proxy eliminates the need to channel all service requests through an intermediate server-side application, which is otherwise necessary to avoid exposing your service credentials from your client application.
Expand Down Expand Up @@ -352,6 +356,9 @@ private void OnGetToken(AuthenticationToken authenticationToken, string customDa
}
```

## Streaming outside of US South region
Watson services have upgraded their hosts to TLS 1.2. The US South region has a TLS 1.0 endpoint that will work for streaming but if you are streaming in other regions you will need to use Unity 2018.2 and set Scripting Runtime Version in Build Settings to .NET 4.x equivalent. In lower versions of Unity you will need to create the Speech to Text instance in US South.

## Documentation
Documentation can be found [here][documentation]. You can also access the documentation by selecting API Reference the Watson menu (**Watson -> API Reference**).

Expand Down
Loading