remove heath from code
This commit is contained in:
		| @@ -6,9 +6,9 @@ | |||||||
|     public class Schemes |     public class Schemes | ||||||
|     { |     { | ||||||
|         /// <summary> |         /// <summary> | ||||||
|         /// The heath scheme. |         /// The default scheme. | ||||||
|         /// </summary> |         /// </summary> | ||||||
|         public const string HeathScheme = "HeathScheme"; |         public const string DefaultScheme = "DefaultScheme"; | ||||||
|  |  | ||||||
|         /// <summary> |         /// <summary> | ||||||
|         /// The azure scheme. |         /// The azure scheme. | ||||||
|   | |||||||
| @@ -49,10 +49,10 @@ namespace Core.Thalos.Adapters.Common.Constants | |||||||
|         public const string AzureADTenantId = "B2C:TenantId"; |         public const string AzureADTenantId = "B2C:TenantId"; | ||||||
|         public const string AzureADClientId = "B2C:ClientId"; |         public const string AzureADClientId = "B2C:ClientId"; | ||||||
|         public const string AzureADClientSecret = "B2C:ClientSecret"; |         public const string AzureADClientSecret = "B2C:ClientSecret"; | ||||||
|         public const string HeathThalosAppAuthorizationUrl = "Swagger:AuthorizationUri"; |         public const string ThalosAppAuthorizationUrl = "Swagger:AuthorizationUri"; | ||||||
|         public const string HeathThalosAppTokenUrl = "Swagger:TokenUri"; |         public const string ThalosAppTokenUrl = "Swagger:TokenUri"; | ||||||
|         public const string HeathThalosAppClientId = "Swagger:ClientId"; |         public const string ThalosAppClientId = "Swagger:ClientId"; | ||||||
|         public const string HeathThalosAppScope = "Swagger:Scope"; |         public const string ThalosAppScope = "Swagger:Scope"; | ||||||
|         public const string PrivateKey = "B2C:JwtIssuerOptions:TokenPrivateKey"; |         public const string PrivateKey = "B2C:JwtIssuerOptions:TokenPrivateKey"; | ||||||
|         public const string PublicKey = "B2C:JwtIssuerOptions:TokenPublicKey"; |         public const string PublicKey = "B2C:JwtIssuerOptions:TokenPublicKey"; | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -68,7 +68,7 @@ namespace Core.Thalos.Adapters.Extensions | |||||||
|                 throw new InvalidOperationException("JwtIssuerOptions are not configured correctly."); |                 throw new InvalidOperationException("JwtIssuerOptions are not configured correctly."); | ||||||
|  |  | ||||||
|             services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) |             services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) | ||||||
|             .AddJwtBearer(Schemes.HeathScheme, x => |             .AddJwtBearer(Schemes.DefaultScheme, x => | ||||||
|             { |             { | ||||||
|                 x.TokenValidationParameters = new TokenValidationParameters |                 x.TokenValidationParameters = new TokenValidationParameters | ||||||
|                 { |                 { | ||||||
|   | |||||||
| @@ -53,11 +53,11 @@ namespace Core.Thalos.Adapters.Extensions | |||||||
|                         { |                         { | ||||||
|                             AuthorizationCode = new OpenApiOAuthFlow |                             AuthorizationCode = new OpenApiOAuthFlow | ||||||
|                             { |                             { | ||||||
|                                 AuthorizationUrl = new Uri(authSettings.HeathThalosAppAuthorizationUrl ?? string.Empty), |                                 AuthorizationUrl = new Uri(authSettings.ThalosAppAuthorizationUrl ?? string.Empty), | ||||||
|                                 TokenUrl = new Uri(authSettings.HeathThalosAppTokenUrl ?? string.Empty), |                                 TokenUrl = new Uri(authSettings.ThalosAppTokenUrl ?? string.Empty), | ||||||
|                                 Scopes = new Dictionary<string, string> |                                 Scopes = new Dictionary<string, string> | ||||||
|                                 { |                                 { | ||||||
|                                 { authSettings.HeathThalosAppScope ?? string.Empty, "Access API as User" } |                                 { authSettings.ThalosAppScope ?? string.Empty, "Access API as User" } | ||||||
|                                 } |                                 } | ||||||
|                             } |                             } | ||||||
|                         } |                         } | ||||||
| @@ -70,7 +70,7 @@ namespace Core.Thalos.Adapters.Extensions | |||||||
|                         { |                         { | ||||||
|                             Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "oauth2" } |                             Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "oauth2" } | ||||||
|                         }, |                         }, | ||||||
|                         new[] { authSettings.HeathThalosAppScope } |                         new[] { authSettings.ThalosAppScope } | ||||||
|                     } |                     } | ||||||
|                     }); |                     }); | ||||||
|  |  | ||||||
| @@ -134,7 +134,7 @@ namespace Core.Thalos.Adapters.Extensions | |||||||
|             app.UseSwaggerUI(options => |             app.UseSwaggerUI(options => | ||||||
|             { |             { | ||||||
|                 options.SwaggerEndpoint("/swagger/v1/swagger.json", "Custom Auth API with Azure AD v1"); |                 options.SwaggerEndpoint("/swagger/v1/swagger.json", "Custom Auth API with Azure AD v1"); | ||||||
|                 options.OAuthClientId(authSettings.HeathThalosAppClientId); |                 options.OAuthClientId(authSettings.ThalosAppClientId); | ||||||
|                 options.OAuthUsePkce(); |                 options.OAuthUsePkce(); | ||||||
|                 options.OAuthScopeSeparator(" "); |                 options.OAuthScopeSeparator(" "); | ||||||
|             }); |             }); | ||||||
|   | |||||||
| @@ -25,7 +25,7 @@ namespace Core.Thalos.Adapters.Helpers | |||||||
|                     throw new ArgumentException("The app configuration is missing"); |                     throw new ArgumentException("The app configuration is missing"); | ||||||
|  |  | ||||||
|                 options.Connect(new Uri(endpoint), new DefaultAzureCredential()) |                 options.Connect(new Uri(endpoint), new DefaultAzureCredential()) | ||||||
|                        .Select(KeyFilter.Any, "cerberos_common") |                        .Select(KeyFilter.Any, "thalos_common") | ||||||
|                        .Select(KeyFilter.Any, appConfigLabel); |                        .Select(KeyFilter.Any, appConfigLabel); | ||||||
|  |  | ||||||
|                 options.ConfigureKeyVault(keyVaultOptions => |                 options.ConfigureKeyVault(keyVaultOptions => | ||||||
| @@ -40,10 +40,10 @@ namespace Core.Thalos.Adapters.Helpers | |||||||
|                 AzureADTenantId = builder.Configuration.GetSection(Secrets.AzureADTenantId).Value, |                 AzureADTenantId = builder.Configuration.GetSection(Secrets.AzureADTenantId).Value, | ||||||
|                 AzureADClientId = builder.Configuration.GetSection(Secrets.AzureADClientId).Value, |                 AzureADClientId = builder.Configuration.GetSection(Secrets.AzureADClientId).Value, | ||||||
|                 AzureADClientSecret = builder.Configuration.GetSection(Secrets.AzureADClientSecret).Value, |                 AzureADClientSecret = builder.Configuration.GetSection(Secrets.AzureADClientSecret).Value, | ||||||
|                 HeathThalosAppAuthorizationUrl = builder.Configuration.GetSection(Secrets.HeathThalosAppAuthorizationUrl).Value, |                 ThalosAppAuthorizationUrl = builder.Configuration.GetSection(Secrets.ThalosAppAuthorizationUrl).Value, | ||||||
|                 HeathThalosAppTokenUrl = builder.Configuration.GetSection(Secrets.HeathThalosAppTokenUrl).Value, |                 ThalosAppTokenUrl = builder.Configuration.GetSection(Secrets.ThalosAppTokenUrl).Value, | ||||||
|                 HeathThalosAppClientId = builder.Configuration.GetSection(Secrets.HeathThalosAppClientId).Value, |                 ThalosAppClientId = builder.Configuration.GetSection(Secrets.ThalosAppClientId).Value, | ||||||
|                 HeathThalosAppScope = builder.Configuration.GetSection(Secrets.HeathThalosAppScope).Value, |                 ThalosAppScope = builder.Configuration.GetSection(Secrets.ThalosAppScope).Value, | ||||||
|                 PrivateKey = builder.Configuration.GetSection(Secrets.PrivateKey).Value, |                 PrivateKey = builder.Configuration.GetSection(Secrets.PrivateKey).Value, | ||||||
|                 PublicKey = builder.Configuration.GetSection(Secrets.PublicKey).Value, |                 PublicKey = builder.Configuration.GetSection(Secrets.PublicKey).Value, | ||||||
|             }; |             }; | ||||||
|   | |||||||
| @@ -62,7 +62,7 @@ namespace Core.Thalos.Adapters.Helpers | |||||||
|         /// <returns>The private key.</returns> |         /// <returns>The private key.</returns> | ||||||
|         private RSACryptoServiceProvider GetPrivateKeyFromPemFile() |         private RSACryptoServiceProvider GetPrivateKeyFromPemFile() | ||||||
|         { |         { | ||||||
|             using (TextReader privateKeyTextReader = new StringReader(File.ReadAllText(Path.Combine(exeDirectory, "HeathPrivateKey.pem")))) |             using (TextReader privateKeyTextReader = new StringReader(File.ReadAllText(Path.Combine(exeDirectory, "PrivateKey.pem")))) | ||||||
|             { |             { | ||||||
|                 AsymmetricCipherKeyPair readKeyPair = (AsymmetricCipherKeyPair)new PemReader(privateKeyTextReader).ReadObject(); |                 AsymmetricCipherKeyPair readKeyPair = (AsymmetricCipherKeyPair)new PemReader(privateKeyTextReader).ReadObject(); | ||||||
|  |  | ||||||
| @@ -79,7 +79,7 @@ namespace Core.Thalos.Adapters.Helpers | |||||||
|         /// <returns>The public key.</returns> |         /// <returns>The public key.</returns> | ||||||
|         public RSACryptoServiceProvider GetPublicKeyFromPemFile() |         public RSACryptoServiceProvider GetPublicKeyFromPemFile() | ||||||
|         { |         { | ||||||
|             using (TextReader publicKeyTextReader = new StringReader(File.ReadAllText(Path.Combine(exeDirectory, "HeathPublicKey.pem")))) |             using (TextReader publicKeyTextReader = new StringReader(File.ReadAllText(Path.Combine(exeDirectory, "PublicKey.pem")))) | ||||||
|             { |             { | ||||||
|                 RsaKeyParameters publicKeyParam = (RsaKeyParameters)new PemReader(publicKeyTextReader).ReadObject(); |                 RsaKeyParameters publicKeyParam = (RsaKeyParameters)new PemReader(publicKeyTextReader).ReadObject(); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -12,11 +12,11 @@ public class AuthSettings | |||||||
|     public string? AzureADClientId { get; set; } |     public string? AzureADClientId { get; set; } | ||||||
|     public string? AzureADClientSecret { get; set; } |     public string? AzureADClientSecret { get; set; } | ||||||
|  |  | ||||||
|     // Heath Thalos App Settings |     //Thalos App Settings | ||||||
|     public string? HeathThalosAppAuthorizationUrl { get; set; } |     public string? ThalosAppAuthorizationUrl { get; set; } | ||||||
|     public string? HeathThalosAppTokenUrl { get; set; } |     public string? ThalosAppTokenUrl { get; set; } | ||||||
|     public string? HeathThalosAppClientId { get; set; } |     public string? ThalosAppClientId { get; set; } | ||||||
|     public string? HeathThalosAppScope { get; set; } |     public string? ThalosAppScope { get; set; } | ||||||
|  |  | ||||||
|     // Token Keys |     // Token Keys | ||||||
|     public string? PrivateKey { get; set; } |     public string? PrivateKey { get; set; } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sergio Matias Urquin
					Sergio Matias Urquin