Skip to content

Commit 4a9d869

Browse files
committed
remove targets_role_version and valid_until from TufRepo view, add time_created
1 parent 9365744 commit 4a9d869

File tree

4 files changed

+7
-26
lines changed

4 files changed

+7
-26
lines changed

nexus/db-model/src/tuf_repo.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,9 @@ impl From<TufRepo> for views::TufRepo {
154154
fn from(repo: TufRepo) -> views::TufRepo {
155155
views::TufRepo {
156156
hash: repo.sha256.into(),
157-
targets_role_version: repo.targets_role_version as u64,
158-
valid_until: repo.valid_until,
159157
system_version: repo.system_version.into(),
160158
file_name: repo.file_name,
159+
time_created: repo.time_created,
161160
}
162161
}
163162
}

nexus/tests/integration_tests/updates.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,6 @@ async fn test_repo_upload() -> Result<()> {
339339
initial_repo.system_version, reupload_description.system_version,
340340
"system version matches"
341341
);
342-
assert_eq!(
343-
initial_repo.valid_until, reupload_description.valid_until,
344-
"valid_until matches"
345-
);
346342

347343
// We didn't insert a new repo, so the generation number should still be 2.
348344
assert_eq!(
@@ -363,10 +359,6 @@ async fn test_repo_upload() -> Result<()> {
363359
initial_repo.system_version, repo.system_version,
364360
"system version matches"
365361
);
366-
assert_eq!(
367-
initial_repo.valid_until, repo.valid_until,
368-
"valid_until matches"
369-
);
370362

371363
// Upload a new repository with the same system version but a different
372364
// version for one of the components. This will produce a different hash,

nexus/types/src/external_api/views.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,12 +1601,6 @@ pub struct TufRepo {
16011601
/// convenience.
16021602
pub hash: ArtifactHash,
16031603

1604-
/// The version of the targets role
1605-
pub targets_role_version: u64,
1606-
1607-
/// The time until which the repo is valid
1608-
pub valid_until: DateTime<Utc>,
1609-
16101604
/// The system version in artifacts.json
16111605
pub system_version: Version,
16121606

@@ -1616,6 +1610,9 @@ pub struct TufRepo {
16161610
/// with wicket, we read the file contents from stdin so we don't know the
16171611
/// correct file name).
16181612
pub file_name: String,
1613+
1614+
/// Time the repository was uploaded
1615+
pub time_created: DateTime<Utc>,
16191616
}
16201617

16211618
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]

openapi/nexus.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25881,14 +25881,8 @@
2588125881
"type": "string",
2588225882
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
2588325883
},
25884-
"targets_role_version": {
25885-
"description": "The version of the targets role",
25886-
"type": "integer",
25887-
"format": "uint64",
25888-
"minimum": 0
25889-
},
25890-
"valid_until": {
25891-
"description": "The time until which the repo is valid",
25884+
"time_created": {
25885+
"description": "Time the repository was uploaded",
2589225886
"type": "string",
2589325887
"format": "date-time"
2589425888
}
@@ -25897,8 +25891,7 @@
2589725891
"file_name",
2589825892
"hash",
2589925893
"system_version",
25900-
"targets_role_version",
25901-
"valid_until"
25894+
"time_created"
2590225895
]
2590325896
},
2590425897
"TufRepoResultsPage": {

0 commit comments

Comments
 (0)