Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added typed entities for Get-PnPAzureADServicePrincipal #2717

Merged
merged 2 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Improved `Register-PnPAzureADApp` and `Register-PnPManagementShellAccess` cmdlets to reuse existing HTTP client instead of creating a new one. [#2682](https://github.com/pnp/powershell/pull/2682)
- Improved `Register-PnPAzureADApp` cmdlet based on compiler warnings. [#2682](https://github.com/pnp/powershell/pull/2682)
- `Connect-PnPOnline` will now throw a much clearer error message if the site to be connected doesn't exist when using the legacy Client Id with Secret (ACS) authentication mode. [#2707](https://github.com/pnp/powershell/pull/2707)
- Properties of `Get-PnPAzureADServicePrincipal` are now all typed instead of some of them returning unparsed JSON fragments

### Removed

Expand Down
48 changes: 24 additions & 24 deletions src/Commands/Model/AzureAD/AzureADServicePrincipal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class AzureADServicePrincipal
public string Id { get; set; }

[JsonPropertyName("deletedDateTime")]
public object DeletedDateTime { get; set; }
public DateTime? DeletedDateTime { get; set; }

[JsonPropertyName("accountEnabled")]
public bool AccountEnabled { get; set; }
Expand All @@ -19,58 +19,58 @@ public class AzureADServicePrincipal
public List<string> AlternativeNames { get; set; }

[JsonPropertyName("appDisplayName")]
public object AppDisplayName { get; set; }
public string AppDisplayName { get; set; }

[JsonPropertyName("appDescription")]
public object AppDescription { get; set; }
public string AppDescription { get; set; }

[JsonPropertyName("appId")]
public string AppId { get; set; }

[JsonPropertyName("applicationTemplateId")]
public object ApplicationTemplateId { get; set; }
public string ApplicationTemplateId { get; set; }

[JsonPropertyName("appOwnerOrganizationId")]
public object AppOwnerOrganizationId { get; set; }
public string AppOwnerOrganizationId { get; set; }

[JsonPropertyName("appRoleAssignmentRequired")]
public bool AppRoleAssignmentRequired { get; set; }
public bool? AppRoleAssignmentRequired { get; set; }

[JsonPropertyName("createdDateTime")]
public DateTime CreatedDateTime { get; set; }
public DateTime? CreatedDateTime { get; set; }

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

[JsonPropertyName("disabledByMicrosoftStatus")]
public object DisabledByMicrosoftStatus { get; set; }
public string DisabledByMicrosoftStatus { get; set; }

[JsonPropertyName("displayName")]
public string DisplayName { get; set; }

[JsonPropertyName("homepage")]
public object Homepage { get; set; }
public string Homepage { get; set; }

[JsonPropertyName("loginUrl")]
public object LoginUrl { get; set; }
public string LoginUrl { get; set; }

[JsonPropertyName("logoutUrl")]
public object LogoutUrl { get; set; }
public string LogoutUrl { get; set; }

[JsonPropertyName("notes")]
public object Notes { get; set; }
public string Notes { get; set; }

[JsonPropertyName("notificationEmailAddresses")]
public List<object> NotificationEmailAddresses { get; set; }
public List<string> NotificationEmailAddresses { get; set; }

[JsonPropertyName("preferredSingleSignOnMode")]
public object PreferredSingleSignOnMode { get; set; }
public string PreferredSingleSignOnMode { get; set; }

[JsonPropertyName("preferredTokenSigningKeyThumbprint")]
public object PreferredTokenSigningKeyThumbprint { get; set; }
public string PreferredTokenSigningKeyThumbprint { get; set; }

[JsonPropertyName("replyUrls")]
public List<object> ReplyUrls { get; set; }
public List<string> ReplyUrls { get; set; }

[JsonPropertyName("servicePrincipalNames")]
public List<string> ServicePrincipalNames { get; set; }
Expand All @@ -79,16 +79,16 @@ public class AzureADServicePrincipal
public string ServicePrincipalType { get; set; }

[JsonPropertyName("signInAudience")]
public object SignInAudience { get; set; }
public string SignInAudience { get; set; }

[JsonPropertyName("tags")]
public List<object> Tags { get; set; }
public List<string> Tags { get; set; }

[JsonPropertyName("tokenEncryptionKeyId")]
public object TokenEncryptionKeyId { get; set; }
public string TokenEncryptionKeyId { get; set; }

[JsonPropertyName("info")]
public object Info { get; set; }
public AzureADServicePrincipalInfo Info { get; set; }

[JsonPropertyName("samlSingleSignOnSettings")]
public object SamlSingleSignOnSettings { get; set; }
Expand All @@ -103,13 +103,13 @@ public class AzureADServicePrincipal
public List<AzureADServicePrincipalKeyCredential> KeyCredentials { get; set; }

[JsonPropertyName("oauth2PermissionScopes")]
public List<object> Oauth2PermissionScopes { get; set; }
public List<AzureADServicePrincipalOauth2PermissionScopes> Oauth2PermissionScopes { get; set; }

[JsonPropertyName("passwordCredentials")]
public List<object> PasswordCredentials { get; set; }
public List<AzureADServicePrincipalPasswordCredentials> PasswordCredentials { get; set; }

[JsonPropertyName("resourceSpecificApplicationPermissions")]
public List<object> ResourceSpecificApplicationPermissions { get; set; }
public List<AzureADServicePrincipalResourceSpecificApplicationPermissions> ResourceSpecificApplicationPermissions { get; set; }

[JsonPropertyName("verifiedPublisher")]
public AzureADServicePrincipalVerifiedPublisher VerifiedPublisher { get; set; }
Expand Down
25 changes: 25 additions & 0 deletions src/Commands/Model/AzureAD/AzureADServicePrincipalInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Text.Json.Serialization;

namespace PnP.PowerShell.Commands.Model.AzureAD
{
/// <summary>
/// Info section within an Azure Active Directory Service Principal entity
/// </summary>
public class AzureADServicePrincipalInfo
{
[JsonPropertyName("logoUrl")]
public string LogoUrl { get; set; }

[JsonPropertyName("marketingUrl")]
public string MarketingUrl { get; set; }

[JsonPropertyName("privacyStatementUrl")]
public string PrivacyStatementUrl { get; set; }

[JsonPropertyName("supportUrl")]
public string SupportUrl { get; set; }

[JsonPropertyName("termsOfServiceUrl")]
public string TermsOfServiceUrl { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Text.Json.Serialization;

namespace PnP.PowerShell.Commands.Model.AzureAD
{
/// <summary>
/// Oauth2PermissionScopes section within an Azure Active Directory Service Principal entity
/// </summary>
public class AzureADServicePrincipalOauth2PermissionScopes
{
[JsonPropertyName("adminConsentDescription")]
public string AdminConsentDescription { get; set; }

[JsonPropertyName("adminConsentDisplayName")]
public string AdminConsentDisplayName { get; set; }

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

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

[JsonPropertyName("type")]
public string Type { get; set; }

[JsonPropertyName("userConsentDisplayName")]
public string UserConsentDisplayName { get; set; }

[JsonPropertyName("userConsentDescription")]
public string UserConsentDescription { get; set; }

[JsonPropertyName("value")]
public string Value { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Text.Json.Serialization;

namespace PnP.PowerShell.Commands.Model.AzureAD
{
/// <summary>
/// PasswordCredentials section within an Azure Active Directory Service Principal entity
/// </summary>
public class AzureADServicePrincipalPasswordCredentials
{
[JsonPropertyName("customKeyIdentifier")]
public string customKeyIdentifier { get; set; }

[JsonPropertyName("displayName")]
public string DisplayName { get; set; }

[JsonPropertyName("endDateTime")]
public DateTime? EndDateTime { get; set; }

[JsonPropertyName("hint")]
public string Hint { get; set; }

[JsonPropertyName("keyId")]
public Guid? KeyId { get; set; }

[JsonPropertyName("secretText")]
public string SecretText { get; set; }

[JsonPropertyName("startDateTime")]
public DateTime? StartDateTime { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Text.Json.Serialization;

namespace PnP.PowerShell.Commands.Model.AzureAD
{
/// <summary>
/// ResourceSpecificApplicationPermissions section within an Azure Active Directory Service Principal entity
/// </summary>
public class AzureADServicePrincipalResourceSpecificApplicationPermissions
{
[JsonPropertyName("description")]
public string Description { get; set; }

[JsonPropertyName("displayName")]
public string DisplayName { get; set; }

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

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

[JsonPropertyName("value")]
public string Value { get; set; }
}
}