@@ -20,6 +20,7 @@ import struct TSCUtility.Version
20
20
21
21
public protocol PackageSigningEntityStorage {
22
22
/// For a given package, return the signing entities and the package versions that each of them signed.
23
+ @available ( * , noasync, message: " Use the async alternative " )
23
24
func get(
24
25
package : PackageIdentity ,
25
26
observabilityScope: ObservabilityScope ,
@@ -31,6 +32,7 @@ public protocol PackageSigningEntityStorage {
31
32
///
32
33
/// This throws `PackageSigningEntityStorageError.conflict` if `signingEntity`
33
34
/// of the package version is different from that in storage.
35
+ @available ( * , noasync, message: " Use the async alternative " )
34
36
func put(
35
37
package : PackageIdentity ,
36
38
version: Version ,
@@ -46,6 +48,7 @@ public protocol PackageSigningEntityStorage {
46
48
/// If the package version already has other `SigningEntity`s in storage, this
47
49
/// API **adds** `signingEntity` to the package version's signers rather than
48
50
/// throwing an error.
51
+ @available ( * , noasync, message: " Use the async alternative " )
49
52
func add(
50
53
package : PackageIdentity ,
51
54
version: Version ,
@@ -57,6 +60,7 @@ public protocol PackageSigningEntityStorage {
57
60
)
58
61
59
62
/// Make `signingEntity` the package's expected signer starting from the given version.
63
+ @available ( * , noasync, message: " Use the async alternative " )
60
64
func changeSigningEntityFromVersion(
61
65
package : PackageIdentity ,
62
66
version: Version ,
@@ -71,6 +75,7 @@ public protocol PackageSigningEntityStorage {
71
75
///
72
76
/// This API deletes all other existing signers from storage, therefore making
73
77
/// `signingEntity` the package's sole signer.
78
+ @available ( * , noasync, message: " Use the async alternative " )
74
79
func changeSigningEntityForAllVersions(
75
80
package : PackageIdentity ,
76
81
version: Version ,
@@ -82,6 +87,107 @@ public protocol PackageSigningEntityStorage {
82
87
)
83
88
}
84
89
90
+ public extension PackageSigningEntityStorage {
91
+ func get(
92
+ package : PackageIdentity ,
93
+ observabilityScope: ObservabilityScope ,
94
+ callbackQueue: DispatchQueue
95
+ ) async throws -> PackageSigners {
96
+ try await safe_async {
97
+ self . get (
98
+ package : package ,
99
+ observabilityScope: observabilityScope,
100
+ callbackQueue: callbackQueue,
101
+ callback: $0
102
+ )
103
+ }
104
+ }
105
+
106
+ func put(
107
+ package : PackageIdentity ,
108
+ version: Version ,
109
+ signingEntity: SigningEntity ,
110
+ origin: SigningEntity . Origin ,
111
+ observabilityScope: ObservabilityScope ,
112
+ callbackQueue: DispatchQueue
113
+ ) async throws {
114
+ try await safe_async {
115
+ self . put (
116
+ package : package ,
117
+ version: version,
118
+ signingEntity: signingEntity,
119
+ origin: origin,
120
+ observabilityScope: observabilityScope,
121
+ callbackQueue: callbackQueue,
122
+ callback: $0
123
+ )
124
+ }
125
+ }
126
+
127
+ func add(
128
+ package : PackageIdentity ,
129
+ version: Version ,
130
+ signingEntity: SigningEntity ,
131
+ origin: SigningEntity . Origin ,
132
+ observabilityScope: ObservabilityScope ,
133
+ callbackQueue: DispatchQueue
134
+ ) async throws {
135
+ try await safe_async {
136
+ self . add (
137
+ package : package ,
138
+ version: version,
139
+ signingEntity: signingEntity,
140
+ origin: origin,
141
+ observabilityScope: observabilityScope,
142
+ callbackQueue: callbackQueue,
143
+ callback: $0
144
+ )
145
+ }
146
+ }
147
+
148
+ func changeSigningEntityFromVersion(
149
+ package : PackageIdentity ,
150
+ version: Version ,
151
+ signingEntity: SigningEntity ,
152
+ origin: SigningEntity . Origin ,
153
+ observabilityScope: ObservabilityScope ,
154
+ callbackQueue: DispatchQueue
155
+ ) async throws {
156
+ try await safe_async {
157
+ self . changeSigningEntityFromVersion (
158
+ package : package ,
159
+ version: version,
160
+ signingEntity: signingEntity,
161
+ origin: origin,
162
+ observabilityScope: observabilityScope,
163
+ callbackQueue: callbackQueue,
164
+ callback: $0
165
+ )
166
+ }
167
+ }
168
+
169
+ func changeSigningEntityForAllVersions(
170
+ package : PackageIdentity ,
171
+ version: Version ,
172
+ signingEntity: SigningEntity ,
173
+ origin: SigningEntity . Origin ,
174
+ observabilityScope: ObservabilityScope ,
175
+ callbackQueue: DispatchQueue
176
+ ) async throws {
177
+ try await safe_async {
178
+ self . changeSigningEntityForAllVersions (
179
+ package : package ,
180
+ version: version,
181
+ signingEntity: signingEntity,
182
+ origin: origin,
183
+ observabilityScope: observabilityScope,
184
+ callbackQueue: callbackQueue,
185
+ callback: $0
186
+ )
187
+ }
188
+ }
189
+ }
190
+
85
191
// MARK: - Models
86
192
87
193
extension SigningEntity {
0 commit comments