Skip to content

Commit b99087c

Browse files
authored
Merge pull request #13 from fossology/development
Development to master
2 parents b3d6444 + 99a5024 commit b99087c

15 files changed

+4115
-39
lines changed

ChangeLog.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# ChangeLog - FOSSology.REST.dotnet
22

3+
## 1.4.0 (2023-03-21)
4+
5+
* support REST API 1.5.1 feaures:
6+
* support new maintenance endpoint.
7+
* support new upload features.
8+
* new `GetUploadFileById` to download an upload file.
9+
* new `GetUploadCopyrights` to get the copyrights for an upload.
10+
* not yet implemented:
11+
* set permissions for a upload in a folder for different groups (`/uploads/{id}/permissions`)
12+
* get all the groups with their respective permissions for a upload (`/uploads/{id}/perm-groups`)
13+
* create a new user (`POST /users`)
14+
* edit user details by id (`PUT /users`)
15+
* create a new REST API token (`POST /users/tokens`)
16+
* get all the REST API tokens for a user (`/users/tokens/{type}`)
17+
* get all jobs created by all users (`/jobs/all`)
18+
* return jobs for the given upload id (`/jobs/history`)
19+
* delete group by id (`/groups/{id}/user/{userId}`)
20+
* selete group member by groupId and userId (`/groups/{id}/user/{userId}`)
21+
* importing ...
22+
* get a list of license candidates from the database (`/license/admincandidates`)
23+
324
## 1.3.0 (2022-12-30)
425

526
* all dependencies updates to the latest version.

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>1.3</Version>
4-
<FileVersion>1.3.0.0</FileVersion>
3+
<Version>1.4</Version>
4+
<FileVersion>1.4.0.0</FileVersion>
55
<Product>Fossology.Rest.Dotnet</Product>
66
<Company></Company>
7-
<Copyright>Copyright © 2019-2022 T. Graf</Copyright>
7+
<Copyright>Copyright © 2019-2023 T. Graf</Copyright>
88
<Authors>T. Graf</Authors>
99
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1010
<RepositoryType>git</RepositoryType>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// ---------------------------------------------------------------------------
2+
// <copyright file="CopyrightEntry.cs" company="Tethys">
3+
// Copyright (C) 2023 T. Graf
4+
// </copyright>
5+
//
6+
// Licensed under the MIT License.
7+
// SPDX-License-Identifier: MIT
8+
//
9+
// Unless required by applicable law or agreed to in writing,
10+
// software distributed under the License is distributed on an
11+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
12+
// either express or implied.
13+
// ---------------------------------------------------------------------------
14+
15+
namespace Fossology.Rest.Dotnet.Model
16+
{
17+
using System.Collections.Generic;
18+
19+
using Newtonsoft.Json;
20+
21+
/// <summary>
22+
/// Information about a single copyright.
23+
/// </summary>
24+
public class CopyrightEntry
25+
{
26+
/// <summary>
27+
/// Gets or sets the copyright statement.
28+
/// </summary>
29+
[JsonProperty("copyright")]
30+
public string Copyright { get; set; }
31+
32+
/// <summary>
33+
/// Gets or sets the list of files where the copyright was found.
34+
/// </summary>
35+
[JsonProperty("filePath")]
36+
public List<string> FilePath { get; set; }
37+
38+
/// <summary>
39+
/// Initializes a new instance of the <see cref="CopyrightEntry"/> class.
40+
/// </summary>
41+
public CopyrightEntry()
42+
{
43+
this.FilePath = new List<string>();
44+
} // CopyrightEntry()
45+
46+
/// <inheritdoc />
47+
public override string ToString()
48+
{
49+
return $"#{this.FilePath.Count}: {this.Copyright}";
50+
} // ToString()
51+
} // CopyrightEntry
52+
}
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
// ---------------------------------------------------------------------------
2+
// <copyright file="CreateMaintenanceInfo.cs" company="Tethys">
3+
// Copyright (C) 2023 T. Graf
4+
// </copyright>
5+
//
6+
// Licensed under the MIT License.
7+
// SPDX-License-Identifier: MIT
8+
//
9+
// Unless required by applicable law or agreed to in writing,
10+
// software distributed under the License is distributed on an
11+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
12+
// either express or implied.
13+
// ---------------------------------------------------------------------------
14+
15+
namespace Fossology.Rest.Dotnet.Model
16+
{
17+
using System.Collections.Generic;
18+
19+
using Newtonsoft.Json;
20+
21+
/// <summary>
22+
/// Information to start maintenance.
23+
/// </summary>
24+
public class CreateMaintenanceInfo
25+
{
26+
/// <summary>
27+
/// No documentation on option 'a' available yet.
28+
/// </summary>
29+
public const string Optiona = "a";
30+
31+
/// <summary>
32+
/// No documentation on option 'A' available yet.
33+
/// </summary>
34+
public const string OptionA = "A";
35+
36+
/// <summary>
37+
/// No documentation on option 'F' available yet.
38+
/// </summary>
39+
public const string OptionF = "F";
40+
41+
/// <summary>
42+
/// No documentation on option 'g' available yet.
43+
/// </summary>
44+
public const string Optiong = "g";
45+
46+
/// <summary>
47+
/// No documentation on option 'E' available yet.
48+
/// </summary>
49+
public const string OptionE = "E";
50+
51+
/// <summary>
52+
/// No documentation on option 'L' available yet.
53+
/// </summary>
54+
public const string OptionL = "L";
55+
56+
/// <summary>
57+
/// No documentation on option 'N' available yet.
58+
/// </summary>
59+
public const string OptionN = "N";
60+
61+
/// <summary>
62+
/// No documentation on option 'R' available yet.
63+
/// </summary>
64+
public const string OptionR = "R";
65+
66+
/// <summary>
67+
/// No documentation on option 't' available yet.
68+
/// </summary>
69+
public const string Optiont = "t";
70+
71+
/// <summary>
72+
/// No documentation on option 'T' available yet.
73+
/// </summary>
74+
public const string OptionT = "T";
75+
76+
/// <summary>
77+
/// No documentation on option 'D' available yet.
78+
/// </summary>
79+
public const string OptionD = "D";
80+
81+
/// <summary>
82+
/// No documentation on option 'Z' available yet.
83+
/// </summary>
84+
public const string OptionZ = "Z";
85+
86+
/// <summary>
87+
/// No documentation on option 'I' available yet.
88+
/// </summary>
89+
public const string OptionI = "I";
90+
91+
/// <summary>
92+
/// No documentation on option 'v' available yet.
93+
/// </summary>
94+
public const string Optionv = "v";
95+
96+
/// <summary>
97+
/// No documentation on option 'o' available yet.
98+
/// </summary>
99+
public const string Optiono = "o";
100+
101+
/// <summary>
102+
/// No documentation on option 'l' available yet.
103+
/// </summary>
104+
public const string Optionl = "l";
105+
106+
/// <summary>
107+
/// Gets or sets the maintenance options.
108+
/// </summary>
109+
[JsonProperty("options")]
110+
public List<string> Options { get; set; }
111+
112+
/// <summary>
113+
/// Gets or sets the date from which to remove older log files from repository.
114+
/// </summary>
115+
[JsonProperty("logsDate")]
116+
public string LogsDate { get; set; }
117+
118+
/// <summary>
119+
/// Gets or sets date from which to remove older gold files from repository.
120+
/// </summary>
121+
[JsonProperty("goldDate")]
122+
public string GoldDate { get; set; }
123+
124+
/// <summary>
125+
/// Initializes a new instance of the <see cref="CreateMaintenanceInfo"/> class.
126+
/// </summary>
127+
public CreateMaintenanceInfo()
128+
{
129+
this.Options = new List<string>();
130+
} // CreateMaintenance()
131+
132+
/// <inheritdoc />
133+
public override string ToString()
134+
{
135+
return $"{this.Options}: {this.LogsDate}, {this.GoldDate}";
136+
} // ToString()
137+
} // CreateMaintenance
138+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// ---------------------------------------------------------------------------
2+
// <copyright file="ScanCodeInfo.cs" company="Tethys">
3+
// Copyright (C) 2023 T. Graf
4+
// </copyright>
5+
//
6+
// Licensed under the MIT License.
7+
// SPDX-License-Identifier: MIT
8+
//
9+
// Unless required by applicable law or agreed to in writing,
10+
// software distributed under the License is distributed on an
11+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
12+
// either express or implied.
13+
// ---------------------------------------------------------------------------
14+
15+
namespace Fossology.Rest.Dotnet.Model
16+
{
17+
using Newtonsoft.Json;
18+
19+
/// <summary>
20+
/// Trigger ScanCode information.
21+
/// </summary>
22+
public class ScanCodeInfo
23+
{
24+
/// <summary>
25+
/// Gets or sets a value indicating whether to scan for licenses.
26+
/// </summary>
27+
[JsonProperty("license")]
28+
public bool License { get; set; }
29+
30+
/// <summary>
31+
/// Gets or sets a value indicating whether to scan for copyrights.
32+
/// </summary>
33+
[JsonProperty("copyright")]
34+
public bool Copyright { get; set; }
35+
36+
/// <summary>
37+
/// Gets or sets a value indicating whether to scan for emails.
38+
/// </summary>
39+
[JsonProperty("email")]
40+
public bool Email { get; set; }
41+
42+
/// <summary>
43+
/// Gets or sets a value indicating whether to scan for urls.
44+
/// </summary>
45+
[JsonProperty("url")]
46+
public bool Url { get; set; }
47+
} // ScanCodeInfo
48+
}

Fossology.Rest.Dotnet.Model/TriggerInfo.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ---------------------------------------------------------------------------
22
// <copyright file="TriggerInfo.cs" company="Tethys">
3-
// Copyright (C) 2019-2020 T. Graf
3+
// Copyright (C) 2019-2023 T. Graf
44
// </copyright>
55
//
66
// Licensed under the MIT License.
@@ -45,6 +45,12 @@ public class TriggerInfo
4545
"reuse_group": 0,
4646
"reuse_main": true,
4747
"reuse_enhanced": true
48+
},
49+
"scancode": {
50+
"license": true,
51+
"copyright": true,
52+
"email": true,
53+
"url": true
4854
}
4955
}
5056
*/
@@ -67,6 +73,12 @@ public class TriggerInfo
6773
[JsonProperty("reuse")]
6874
public ReuseInfo Reuse { get; set; }
6975

76+
/// <summary>
77+
/// Gets or sets the ScanCode settings.
78+
/// </summary>
79+
[JsonProperty("scancode")]
80+
public ScanCodeInfo Scancode { get; set; }
81+
7082
/// <summary>
7183
/// Initializes a new instance of the <see cref="TriggerInfo"/> class.
7284
/// </summary>
@@ -75,6 +87,7 @@ public TriggerInfo()
7587
this.Analysis = new Analysis();
7688
this.Decider = new DeciderInfo();
7789
this.Reuse = new ReuseInfo();
90+
this.Scancode = new ScanCodeInfo();
7891
} // TriggerInfo()
7992
} // TriggerInfo
8093
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// ---------------------------------------------------------------------------
2+
// <copyright file="UploadInformationFile.cs" company="Tethys">
3+
// Copyright (C) 2019-2023 T. Graf
4+
// </copyright>
5+
//
6+
// Licensed under the MIT License.
7+
// SPDX-License-Identifier: MIT
8+
//
9+
// Unless required by applicable law or agreed to in writing,
10+
// software distributed under the License is distributed on an
11+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
12+
// either express or implied.
13+
// ---------------------------------------------------------------------------
14+
15+
namespace Fossology.Rest.Dotnet.Model
16+
{
17+
using Newtonsoft.Json;
18+
19+
/// <summary>
20+
/// Fossology upload information for files.
21+
/// </summary>
22+
public class UploadInformationFile
23+
{
24+
// IMPORTANT: not 'location' information required at the moment
25+
26+
/// <summary>
27+
/// Gets or sets the scan options.
28+
/// </summary>
29+
[JsonProperty("scanOptions")]
30+
public TriggerInfo ScanOptions { get; set; }
31+
32+
/// <summary>
33+
/// Initializes a new instance of the <see cref="UploadInformationFile" /> class.
34+
/// </summary>
35+
public UploadInformationFile()
36+
{
37+
this.ScanOptions = new TriggerInfo();
38+
} // UploadInformationFile()
39+
} // UploadInformationFile
40+
}

0 commit comments

Comments
 (0)