-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README.md * Pull 2.6.0 changes and regenerate. * Regenerate code with spec 2.7.0. * Add ITs for Orgs API. * Add support for GroupSchema operations. * Add ITs for authenticators and GroupSchema. * Regenerate code using spec 2.7.1. * Add UTs to cover authenticators API. * Add missing header. * Remove gh-pages deployment * Skipping GroupSchema/UserSchema update property ITs which depend on OKTA-431664. * Skipping CreateOktaSignOnRadiusPolicyRule IT which depends on OKTA-431665. * Add sleep to wait for job in RemoveROle test. * Skip temporarily GroupSchemaScenarios.UpdatePropertyToGroupSchemaAsync. Co-authored-by: Andrii Zhegurov <[email protected]>
- Loading branch information
1 parent
4399429
commit 9913188
Showing
58 changed files
with
2,599 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,25 +18,6 @@ script: | |
- if [[ $DEPLOY_DOCS = true && ($TRAVIS_PULL_REQUEST = false && $TRAVIS_BRANCH = master || "$TRAVIS_TAG" != "") ]]; then | ||
./build.sh --target Docs; | ||
fi | ||
deploy: | ||
- provider: pages | ||
skip_cleanup: true | ||
github_token: "$GITHUB_TOKEN" | ||
local_dir: docs/temp | ||
email: [email protected] | ||
name: ".NET Deployment Bot" | ||
on: | ||
condition: "$DEPLOY_DOCS = true" | ||
tags: true | ||
- provider: pages | ||
skip_cleanup: true | ||
github_token: "$GITHUB_TOKEN" | ||
local_dir: docs/temp | ||
email: [email protected] | ||
name: ".NET Deployment Bot" | ||
on: | ||
condition: "$DEPLOY_DOCS = true && $TRAVIS_PULL_REQUEST = false" | ||
branch: master | ||
notifications: | ||
slack: | ||
if: type = cron | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// <copyright file="AuthenticatorScenarios.cs" company="Okta, Inc"> | ||
// Copyright (c) 2020 - present Okta, Inc. All rights reserved. | ||
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. | ||
// </copyright> | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using FluentAssertions; | ||
using FluentAssertions.Extensions; | ||
using Xunit; | ||
|
||
namespace Okta.Sdk.IntegrationTests | ||
{ | ||
public class AuthenticatorScenarios | ||
{ | ||
[Fact] | ||
public async Task ListAuthenticatorsAsync() | ||
{ | ||
var client = TestClient.Create(); | ||
|
||
var authenticators = await client.Authenticators.ListAuthenticators().ToListAsync(); | ||
|
||
authenticators.Should().NotBeNullOrEmpty(); | ||
authenticators.Select(x => x.Type.ToString()).Should().BeSubsetOf(new List<string> { "app", "password", "security_question", "phone", "email", "security_key" }); | ||
} | ||
|
||
[Fact] | ||
public async Task GetAuthenticatorByIdAsync() | ||
{ | ||
var client = TestClient.Create(); | ||
|
||
var authenticators = await client.Authenticators.ListAuthenticators().ToListAsync(); | ||
// Password should be enabled | ||
var passwordAuthenticator = authenticators.FirstOrDefault(x => x.Type == AuthenticatorType.Password); | ||
|
||
var retrievedAuthenticator = await client.Authenticators.GetAuthenticatorAsync(passwordAuthenticator.Id); | ||
|
||
retrievedAuthenticator.Key.Should().Be(passwordAuthenticator.Key); | ||
retrievedAuthenticator.Name.Should().Be(passwordAuthenticator.Name); | ||
retrievedAuthenticator.Status.Should().Be(passwordAuthenticator.Status); | ||
retrievedAuthenticator.Created.Should().Be(passwordAuthenticator.Created); | ||
retrievedAuthenticator.Settings.Should().Be(passwordAuthenticator.Settings); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// <copyright file="GroupSchemaScenarios.cs" company="Okta, Inc"> | ||
// Copyright (c) 2020 - present Okta, Inc. All rights reserved. | ||
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. | ||
// </copyright> | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using FluentAssertions; | ||
using Xunit; | ||
|
||
namespace Okta.Sdk.IntegrationTests | ||
{ | ||
public class GroupSchemaScenarios | ||
{ | ||
[Fact] | ||
public async Task GetGroupSchemaAsync() | ||
{ | ||
var client = TestClient.Create(); | ||
|
||
var groupSchema = await client.GroupSchemas.GetGroupSchemaAsync(); | ||
groupSchema.Should().NotBeNull(); | ||
groupSchema.Schema.Should().Be("http://json-schema.org/draft-04/schema#"); | ||
groupSchema.Definitions?.Base?.Id.Should().Be("#base"); | ||
groupSchema.Definitions?.Custom?.Id.Should().Be("#custom"); | ||
groupSchema.Name.Should().Be("group"); | ||
} | ||
|
||
[Fact(Skip = "Depends on OKTA-431664")] | ||
public async Task UpdatePropertyToGroupSchemaAsync() | ||
{ | ||
var client = TestClient.Create(); | ||
|
||
var groupSchema = await client.GroupSchemas.GetGroupSchemaAsync(); | ||
var guid = Guid.NewGuid(); | ||
|
||
// Add custom attribute | ||
var customAttributeDetails = new GroupSchemaAttribute() | ||
{ | ||
Title = "Group administrative contact", | ||
Type = "string", | ||
Description = guid.ToString(), | ||
MinLength = 1, | ||
MaxLength = 20, | ||
Permissions = new List<IUserSchemaAttributePermission> | ||
{ | ||
new UserSchemaAttributePermission | ||
{ | ||
Action = "READ_WRITE", | ||
Principal = "SELF", | ||
}, | ||
}, | ||
}; | ||
|
||
var customAttribute = new Resource(); | ||
customAttribute["groupContact"] = customAttributeDetails; | ||
groupSchema.Definitions.Custom.Properties = customAttribute; | ||
|
||
var updatedGroupSchema = await client.GroupSchemas.UpdateGroupSchemaAsync(groupSchema); | ||
|
||
var retrievedCustomAttribute = updatedGroupSchema.Definitions.Custom.Properties.GetProperty<GroupSchemaAttribute>("groupContact"); | ||
retrievedCustomAttribute.Title.Should().Be("Group administrative contact"); | ||
retrievedCustomAttribute.Type.Should().Be(UserSchemaAttributeType.String); | ||
retrievedCustomAttribute.Description.Should().Be(guid.ToString()); | ||
retrievedCustomAttribute.Required.Should().BeNull(); | ||
retrievedCustomAttribute.MinLength.Should().Be(1); | ||
retrievedCustomAttribute.MaxLength.Should().Be(20); | ||
retrievedCustomAttribute.Permissions.FirstOrDefault().Principal.Should().Be("SELF"); | ||
retrievedCustomAttribute.Permissions.FirstOrDefault().Action.Should().Be("READ_WRITE"); | ||
|
||
// Remove custom attribute | ||
customAttribute["groupContact"] = null; | ||
updatedGroupSchema.Definitions.Custom.Properties = customAttribute; | ||
updatedGroupSchema = await client.GroupSchemas.UpdateGroupSchemaAsync(updatedGroupSchema); | ||
updatedGroupSchema.Definitions.Custom.Properties.GetProperty<UserSchemaAttribute>("groupContact").Should().BeNull(); | ||
} | ||
} | ||
} |
Oops, something went wrong.