feat: Implement API client and token models with hashing and JWT authentication
- Added ApiClientModel and ApiTokenModel for managing API clients and tokens. - Introduced ConfigurationDefinitionModel and ConfigurationValueModel for configuration management. - Created CredentialSecretModel for storing credential secrets. - Developed DeploymentArtifactModel and DeploymentBatchModel for deployment management. - Enhanced DeploymentTargetModel and DeploymentTemplateSelectionModel to support template revisions. - Added TemplateRevisionModel and TemplateVersionModel for versioning templates. - Implemented ApiClientSecretHasher for secure secret hashing. - Created ApiTokenService for generating and validating JWT tokens. - Updated QueueJobService to handle deployment requests with artifacts. - Configured authentication settings in appsettings.json for JWT and Negotiate authentication.
This commit is contained in:
58
Models/DeploymentArtifactModel.cs
Normal file
58
Models/DeploymentArtifactModel.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Models
|
||||
{
|
||||
public static class DeploymentArtifactTypes
|
||||
{
|
||||
public const string Preview = "Preview";
|
||||
public const string ResolvedConfigurationData = "ResolvedConfigurationData";
|
||||
public const string Mof = "Mof";
|
||||
public const string PullServerPackage = "PullServerPackage";
|
||||
}
|
||||
|
||||
public class DeploymentArtifactModel : BaseModel
|
||||
{
|
||||
[Column(Order = 1)]
|
||||
public Guid DeploymentGroupId { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
public Guid? DeploymentTargetId { get; set; }
|
||||
|
||||
[Column(Order = 3)]
|
||||
public Guid? TargetId { get; set; }
|
||||
|
||||
[Column(Order = 4)]
|
||||
public string ArtifactType { get; set; } = DeploymentArtifactTypes.ResolvedConfigurationData;
|
||||
|
||||
[Column(Order = 5)]
|
||||
public string Status { get; set; } = QueueJobStatus.Pending;
|
||||
|
||||
[Column(Order = 6)]
|
||||
public string DeploymentJson { get; set; } = "{}";
|
||||
|
||||
[Column(Order = 7)]
|
||||
public string? SourceJson { get; set; }
|
||||
|
||||
[Column(Order = 8)]
|
||||
public string? ResolvedJson { get; set; }
|
||||
|
||||
[Column(Order = 9)]
|
||||
public string? SourceSnapshotJson { get; set; }
|
||||
|
||||
[Column(Order = 10)]
|
||||
public string InputHash { get; set; } = string.Empty;
|
||||
|
||||
[Column(Order = 11)]
|
||||
public string OutputHash { get; set; } = string.Empty;
|
||||
|
||||
[Column(Order = 12)]
|
||||
public bool IsStale { get; set; }
|
||||
|
||||
[Column(Order = 13)]
|
||||
public string? StaleReasonJson { get; set; }
|
||||
|
||||
public DeploymentGroupModel DeploymentGroup { get; set; } = null!;
|
||||
public DeploymentModel? Deployment { get; set; }
|
||||
public TargetModel? Target { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user