Skip to content

Commit

Permalink
feat: add missing fields to Casdoor objects (#51)
Browse files Browse the repository at this point in the history
* fix: added missing field "passwordOptions" to CasdoorOrganization model

* fix: actualized api & added missing fields to models
  • Loading branch information
souress authored Jul 20, 2023
1 parent edca93b commit 50b578b
Show file tree
Hide file tree
Showing 11 changed files with 362 additions and 22 deletions.
40 changes: 29 additions & 11 deletions src/Casdoor.Client/Models/CasdoorApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ public class CasdoorProviderItem
{
[JsonPropertyName("name")]
public string? Name { get; set; }

[JsonPropertyName("canSignUp")]
public bool? CanSignUp { get; set; }

[JsonPropertyName("canSignIn")]
public bool? CanSignIn { get; set; }

[JsonPropertyName("canUnlink")]
public bool? CanUnlink { get; set; }

[JsonPropertyName("prompted")]
public bool? Prompted { get; set; }

[JsonPropertyName("alertType")]
public string? AlertType { get; set; }

[JsonPropertyName("provider")]
public CasdoorProvider? Provider { get; set; }
}
Expand All @@ -44,7 +44,7 @@ public class CasdoorSignupItem
{
[JsonPropertyName("name")]
public string? Name { get; set; }

[JsonPropertyName("visible")]
public bool? Visible { get; set; }

Expand Down Expand Up @@ -108,18 +108,30 @@ public class CasdoorApplication
[JsonPropertyName("enableWebAuth")]
public bool? EnableWebAuth { get; set; }

[JsonPropertyName("enableLinkWithEmail")]
public bool? EnableLinkWithEmail { get; set; }

[JsonPropertyName("orgChoiceMode")]
public string? OrgChoiceMode { get; set; }

[JsonPropertyName("samlReplyUrl")]
public string? SamlReplyUrl { get; set; }

[JsonPropertyName("providers")]
public CasdoorProviderItem[]? Providers { get; set; }

[JsonPropertyName("signupItems")]
public CasdoorSignupItem[]? SignupItems { get; set; }

[JsonPropertyName("grantTypes")]
[JsonPropertyName("grantTypes")]
public string[]? GrantTypes { get; set; }

[JsonPropertyName("organizationObj")]
public CasdoorOrganization? OrganizationObj { get; set; }


[JsonPropertyName("tags")]
public string[]? Tags { get; set; }

[JsonPropertyName("clientId")]
public string? ClientId { get; set; }

Expand Down Expand Up @@ -159,12 +171,18 @@ public class CasdoorApplication
[JsonPropertyName("signinHtml")]
public string? SigninHtml { get; set; }

[JsonPropertyName("themeData")]
public CasdoorThemeData? ThemeData { get; set; }

[JsonPropertyName("formCss")]
public string? FormCss { get; set; }


[JsonPropertyName("formCssMobile")]
public string? FormCssMobile { get; set; }

[JsonPropertyName("formOffset")]
public int? FormOffset { get; set; }

[JsonPropertyName("formBackgroundUrl")]
public string? FormBackgroundUrl { get; set; }
}
}
3 changes: 3 additions & 0 deletions src/Casdoor.Client/Models/CasdoorEmailForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ public class CasdoorEmailForm

[JsonPropertyName("receivers")]
public string[] Receivers { get; set; } = Array.Empty<string>();

[JsonPropertyName("provider")]
public string Provider { get; set; }

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release-build-version

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 34 in src/Casdoor.Client/Models/CasdoorEmailForm.cs

View workflow job for this annotation

GitHub Actions / release

Non-nullable property 'Provider' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
}
27 changes: 27 additions & 0 deletions src/Casdoor.Client/Models/CasdoorMfaProps.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Text.Json.Serialization;

namespace Casdoor.Client;

public class CasdoorMfaProps
{
[JsonPropertyName("enabled")]
public bool? Enabled { get; set; }

[JsonPropertyName("isPreferred")]
public bool? IsPreferred { get; set; }

[JsonPropertyName("mfaType")]
public string? MfaType { get; set; }

[JsonPropertyName("secret")]
public string? Secret { get; set; }

[JsonPropertyName("countryCode")]
public string? CountryCode { get; set; }

[JsonPropertyName("url")]
public string? Url { get; set; }

[JsonPropertyName("recoveryCodes")]
public string[]? RecoveryCodes { get; set; }
}
34 changes: 29 additions & 5 deletions src/Casdoor.Client/Models/CasdoorOrganization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
namespace Casdoor.Client;


public class CasdoorMfaItem
{
[JsonPropertyName("name")]
public string? Name { get; set; }

[JsonPropertyName("rule")]
public string? Rule { get; set; }
}

public class CasdoorAccountItem
{
[JsonPropertyName("name")]
Expand Down Expand Up @@ -58,8 +67,11 @@ public class CasdoorOrganization
[JsonPropertyName("passwordSalt")]
public string? PasswordSalt { get; set; }

[JsonPropertyName("phonePrefix")]
public string? PhonePrefix { get; set; }
[JsonPropertyName("passwordOptions")]
public string[]? PasswordOptions { get; set; }

[JsonPropertyName("countryCodes")]
public string[]? CountryCodes { get; set; }

[JsonPropertyName("defaultAvatar")]
public string? DefaultAvatar { get; set; }
Expand All @@ -70,15 +82,27 @@ public class CasdoorOrganization
[JsonPropertyName("tags")]
public string[]? Tags { get; set; }

[JsonPropertyName("languages")]
public string[]? Languages { get; set; }

[JsonPropertyName("themeData")]
public CasdoorThemeData? ThemeData { get; set; }

[JsonPropertyName("masterPassword")]
public string? MasterPassword { get; set; }

[JsonPropertyName("initScore")]
public int? InitScore { get; set; }

[JsonPropertyName("enableSoftDeletion")]
public bool? EnableSoftDeletion { get; set; }

[JsonPropertyName("isProfilePublic")]
public bool? IsProfilePublic { get; set; }


[JsonPropertyName("mfaItems")]
public CasdoorMfaItem[]? MfaItems { get; set; }

[JsonPropertyName("accountItems")]
CasdoorAccountItem[]? AccountItems { get; set; }
}
public CasdoorAccountItem[]? AccountItems { get; set; }
}
5 changes: 4 additions & 1 deletion src/Casdoor.Client/Models/CasdoorPermission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public class CasdoorPermission
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }

[JsonPropertyName("description")]
public string? Description { get; set; }

[JsonPropertyName("users")]
public IEnumerable<string>? Users { get; set; }

Expand Down Expand Up @@ -75,4 +78,4 @@ public class CasdoorPermission

[JsonPropertyName("isEnabled")]
public bool IsEnabled { get; set; }
}
}
19 changes: 18 additions & 1 deletion src/Casdoor.Client/Models/CasdoorPermissionRule.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
namespace Casdoor.Client;
using System.Text.Json.Serialization;

namespace Casdoor.Client;

public class CasdoorPermissionRule
{
[JsonPropertyName("ptype")]
public string? Ptype { get; set; }

[JsonPropertyName("v0")]
public string? V0 { get; set; }

[JsonPropertyName("v1")]
public string? V1 { get; set; }

[JsonPropertyName("v2")]
public string? V2 { get; set; }

[JsonPropertyName("v3")]
public string? V3 { get; set; }

[JsonPropertyName("v4")]
public string? V4 { get; set; }

[JsonPropertyName("v5")]
public string? V5 { get; set; }

[JsonPropertyName("id")]
public string? Id { get; set; }
}

Expand Down
11 changes: 10 additions & 1 deletion src/Casdoor.Client/Models/CasdoorProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ public class CasdoorProvider
[JsonPropertyName("customLogo")]
public string? CustomLogo { get; set; }

[JsonPropertyName("scopes")]
public string? Scopes { get; set; }

[JsonPropertyName("userMapping")]
public IDictionary<string, string>? UserMapping { get; set; }

[JsonPropertyName("host")]
public string? Host { get; set; }

Expand Down Expand Up @@ -114,6 +120,9 @@ public class CasdoorProvider
[JsonPropertyName("bucket")]
public string? Bucket { get; set; }

[JsonPropertyName("pathPrefix")]
public string? PathPrefix { get; set; }

[JsonPropertyName("metadata")]
public string? Metadata { get; set; }

Expand All @@ -128,4 +137,4 @@ public class CasdoorProvider

[JsonPropertyName("providerUrl")]
public string? ProviderUrl { get; set; }
}
}
10 changes: 7 additions & 3 deletions src/Casdoor.Client/Models/CasdoorResponse.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2022 The Casdoor Authors. All Rights Reserved.
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -20,6 +20,8 @@ public class CasdoorResponse
{
[JsonPropertyName("status")] public string? Status { get; set; }
[JsonPropertyName("msg")] public string? Msg { get; set; }
[JsonPropertyName("sub")] public string? Sub { get; set; }
[JsonPropertyName("name")] public string? Name { get; set; }
[JsonPropertyName("data")] public object? Data { get; set; }
[JsonPropertyName("data2")] public object? Data2 { get; set; }
}
Expand All @@ -29,6 +31,8 @@ public class CasdoorResponse<T>
{
[JsonPropertyName("status")] public string? Status { get; set; }
[JsonPropertyName("msg")] public string? Msg { get; set; }
[JsonPropertyName("sub")] public string? Sub { get; set; }
[JsonPropertyName("name")] public string? Name { get; set; }
[JsonPropertyName("data")] public T? Data { get; set; }
[JsonPropertyName("data2")] public object? Data2 { get; set; }
}
Expand Down
3 changes: 3 additions & 0 deletions src/Casdoor.Client/Models/CasdoorRole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public class CasdoorRole
[JsonPropertyName("displayName")]
public string? DisplayName { get; set; }

[JsonPropertyName("description")]
public string? Description { get; set; }

[JsonPropertyName("users")]
public IEnumerable<string>? Users { get; set; }

Expand Down
21 changes: 21 additions & 0 deletions src/Casdoor.Client/Models/CasdoorThemeData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Text.Json.Serialization;

namespace Casdoor.Client;

public class CasdoorThemeData
{
[JsonPropertyName("themeType")]
public string? ThemeType { get; set; }

[JsonPropertyName("colorPrimary")]
public string? ColorPrimary { get; set; }

[JsonPropertyName("borderRadius")]
public int? BorderRadius { get; set; }

[JsonPropertyName("isCompact")]
public bool? IsCompact { get; set; }

[JsonPropertyName("isEnabled")]
public bool? IsEnabled { get; set; }
}
Loading

0 comments on commit 50b578b

Please sign in to comment.