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

(GH-6) WIP #7

Open
wants to merge 1 commit into
base: 2.11_adds
Choose a base branch
from
Open
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 src/Core/Packages/DataServicePackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ public string Dependencies
set;
}

public string PackageSource { get; set; }
public string PackageHash { get; set; }
public string PackageHashAlgorithm { get; set; }

Expand Down
1 change: 1 addition & 0 deletions src/Core/Packages/IChocolateyServerPackageMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public partial interface IServerPackageMetadata
LastUpdated = p.LastUpdated,
*/

string PackageSource { get; }
string PackageHash { get; }
string PackageHashAlgorithm { get; }
long PackageSize { get; }
Expand Down
7 changes: 7 additions & 0 deletions src/Server/DataServices/Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public Package(IPackage package, DerivedPackageData derivedData)
PackageHash = derivedData.PackageHash;
PackageHashAlgorithm = "SHA512";
PackageSize = derivedData.PackageSize;
PackageSource = derivedData.PackageSource;
LastUpdated = derivedData.LastUpdated.UtcDateTime;
Published = derivedData.Created.UtcDateTime;
Path = derivedData.Path;
Expand Down Expand Up @@ -224,6 +225,12 @@ public string Dependencies
set;
}

public string PackageSource
{
get;
set;
}

public string PackageHash
{
get;
Expand Down
1 change: 1 addition & 0 deletions src/Server/Infrastructure/DerivedPackageData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class DerivedPackageData
{
public long PackageSize { get; set; }
public string PackageHash { get; set; }
public string PackageSource { get; set; }
public DateTimeOffset LastUpdated { get; set; }
public DateTimeOffset Created { get; set; }
public string Path { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/Server/Infrastructure/ServerPackageRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ private IDictionary<IPackage, DerivedPackageData> CreateCache()
{
PackageSize = fileLength,
PackageHash = Convert.ToBase64String(hashBytes),
PackageSource = this.Source,
LastUpdated = _fileSystem.GetLastModified(path),
Created = _fileSystem.GetCreated(path),
Path = path,
Expand Down