Skip to content

Commit

Permalink
chore: I also have to format stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
svrooij committed Aug 21, 2024
1 parent 6a25d37 commit 02591b0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Svrooij.WinTuner.CmdLets/Commands/BaseIntuneCmdlet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected virtual Task ProcessAuthenticatedAsync(IAuthenticationProvider provide
{
throw new NotImplementedException();
}


private void ValidateAuthenticationParameters()
{
Expand Down
12 changes: 6 additions & 6 deletions src/Svrooij.WinTuner.CmdLets/Commands/ConnectWtWinTuner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public class ConnectWtWinTuner : DependencyCmdlet<Startup>
private const string DefaultClientCredentialScope = "https://graph.microsoft.com/.default";
private const string ParamSetInteractive = "Interactive";
private const string ParamSetClientCredentials = "ClientCredentials";

/// <summary>
/// Used default scopes
/// </summary>
private static readonly string[] DefaultScopes = { "DeviceManagementConfiguration.ReadWrite.All", "DeviceManagementApps.ReadWrite.All" };

internal static IAuthenticationProvider? AuthenticationProvider { get; private set; }

/// <summary>
Expand Down Expand Up @@ -170,7 +170,7 @@ public class ConnectWtWinTuner : DependencyCmdlet<Startup>
/// </summary>
[Parameter(Mandatory = false, Position = 11, HelpMessage = "Try to get a token after connecting, useful for testing.")]
public SwitchParameter Test { get; set; }

[ServiceDependency]
private ILogger<ConnectWtWinTuner>? _logger;

Expand All @@ -195,7 +195,7 @@ private IAuthenticationProvider CreateAuthenticationProvider(CancellationToken c
return new WingetIntune.Internal.Msal.StaticAuthenticationProvider(Token);
}

var scope = (Scopes ?? DefaultScopes)[0];
var scope = (Scopes ?? DefaultScopes)[0];

if (UseManagedIdentity || UseDefaultCredentials)
{
Expand Down Expand Up @@ -257,7 +257,7 @@ private IAuthenticationProvider CreateAuthenticationProvider(CancellationToken c

return new Microsoft.Graph.Authentication.AzureIdentityAuthenticationProvider(credential, isCaeEnabled: false, scopes: Scopes ?? DefaultScopes);
}

return new WingetIntune.Internal.Msal.InteractiveAuthenticationProvider(new WingetIntune.Internal.Msal.InteractiveAuthenticationProviderOptions
{
ClientId = ClientId,
Expand All @@ -270,7 +270,7 @@ private IAuthenticationProvider CreateAuthenticationProvider(CancellationToken c
// This should never happen, but just in case.
throw new NotImplementedException();
}

/// <summary>
/// Asynchronously retrieves a token from the authentication provider.
/// </summary>
Expand Down
3 changes: 2 additions & 1 deletion src/Svrooij.WinTuner.CmdLets/Commands/DeployWtWin32App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ protected override async Task ProcessAuthenticatedAsync(IAuthenticationProvider
if (GraphId is not null)
{
await SupersedeApp(logger!, graphServiceClient, newApp!.Id!, GraphId, cancellationToken);
} else
}
else
{
if (Categories is not null && Categories.Any())
{
Expand Down
6 changes: 3 additions & 3 deletions src/Svrooij.WinTuner.CmdLets/Commands/GetWtToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ public class GetWtToken : BaseIntuneCmdlet
/// </summary>
[Parameter(Mandatory = false, HelpMessage = "Decode the token")]
public SwitchParameter DecodeToken { get; set; }

/// <summary>
/// Output the token to the logs?
/// </summary>
[Parameter(Mandatory = false, HelpMessage = "Output the token to the logs?")]
public SwitchParameter ShowToken { get; set; }

[ServiceDependency]
private ILogger<GetWtToken>? _logger;

Expand All @@ -55,7 +55,7 @@ protected override async Task ProcessAuthenticatedAsync(IAuthenticationProvider
var jwt = new JwtSecurityToken(token);
_logger?.LogInformation("Token claims: {@Claims}", jwt.Claims);
}

WriteObject(token);
}
}

0 comments on commit 02591b0

Please sign in to comment.