This repository was archived by the owner on Jul 30, 2024. It is now read-only.
Commit f50ef65
authored
[Package Signing] Fix idempotency (#267)
Previously, the validate package signature job was designed such that it would fail validation requests for packages that had already been validated unless the validation request was from a revalidation gesture. The idea was that this would make the job "resilient" to unintended state changes caused by message duplication. Essentially, this could happen:
1. Orchestrator sends a `Validate package X's signature` message. Validation passes.
2. Orchestrator resends the `Validate package X's signature` message. Validation fails (even though the signature is still valid).
3. Orchestrator sends a `Revalidate package X's signature` message. Validation passes.
This turned out to be a bad idea as the orchestrator may validate the same package multiple times if it was uploaded multiple times concurrently. With this PR, the new results would be:
1. Orchestrator sends a `Validate package X's signature` message. Validation passes.
2. Orchestrator resends the `Validate package X's signature` message. Validation passes.
3. Orchestrator sends a `Revalidate package X's signature` message. Validation passes.1 parent 384546b commit f50ef65
8 files changed
Lines changed: 35 additions & 109 deletions
File tree
- src/Validation.PackageSigning.ExtractAndValidateSignature
- Storage
- tests/Validation.PackageSigning.ExtractAndValidateSignature.Tests
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
160 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| |||
166 | 169 | | |
167 | 170 | | |
168 | 171 | | |
169 | | - | |
| 172 | + | |
170 | 173 | | |
171 | 174 | | |
172 | 175 | | |
| |||
Lines changed: 20 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
144 | 129 | | |
145 | 130 | | |
146 | 131 | | |
| |||
153 | 138 | | |
154 | 139 | | |
155 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
156 | 149 | | |
157 | 150 | | |
158 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | 161 | | |
168 | 162 | | |
169 | 163 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
Lines changed: 2 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
| 26 | + | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
| |||
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 46 | | |
54 | 47 | | |
55 | 48 | | |
| |||
65 | 58 | | |
66 | 59 | | |
67 | 60 | | |
68 | | - | |
69 | | - | |
70 | 61 | | |
71 | 62 | | |
72 | 63 | | |
src/Validation.PackageSigning.ExtractAndValidateSignature/Storage/SavePackageSigningStateResult.cs
Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
Lines changed: 4 additions & 48 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 28 | + | |
68 | 29 | | |
69 | 30 | | |
70 | 31 | | |
| |||
88 | 49 | | |
89 | 50 | | |
90 | 51 | | |
91 | | - | |
| 52 | + | |
92 | 53 | | |
93 | 54 | | |
94 | 55 | | |
95 | | - | |
96 | 56 | | |
97 | 57 | | |
98 | 58 | | |
99 | | - | |
100 | 59 | | |
101 | 60 | | |
102 | 61 | | |
| |||
105 | 64 | | |
106 | 65 | | |
107 | 66 | | |
108 | | - | |
| 67 | + | |
109 | 68 | | |
110 | 69 | | |
111 | 70 | | |
| |||
122 | 81 | | |
123 | 82 | | |
124 | 83 | | |
125 | | - | |
| 84 | + | |
126 | 85 | | |
127 | 86 | | |
128 | 87 | | |
129 | | - | |
130 | 88 | | |
131 | 89 | | |
132 | 90 | | |
133 | | - | |
134 | | - | |
135 | 91 | | |
136 | 92 | | |
137 | 93 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
0 commit comments