Improved the AuthMiddleware type in the library target by adding input validation and by generating the authentication information once.

This commit is contained in:
2025-10-12 21:26:55 +02:00
parent c2ab60a5aa
commit 21f2901337
4 changed files with 323 additions and 69 deletions
@@ -26,14 +26,7 @@ extension String {
static let token = "token"
}
/// A namespaces assigned for the formats of string values.
enum Format {
/// A format for the consumer authentication header.
static let authConsumer = "Discogs \(String.Parameter.key)=%@, \(String.Parameter.secret)=%@"
/// A format for the user authentication header.
static let authUser = "Discogs \(String.Parameter.token)=%@"
/// A format for the user agent header.
static let userAgent = "%@/%@ +%@"
}
enum Format {}
/// A namespaces assigned for the formats of regular expression patterns.
enum Pattern {}