Implemented the Auth middleware (#3)

This PR contains the work done to implement the `AuthMiddleware` middleware that, when plugged into a `Client` object, adds authentication parameters to any request the client would make.

Reviewed-on: #3
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #3.
This commit is contained in:
2025-10-04 10:57:15 +00:00
committed by Javier Cicchelli
parent 7006aa1bc8
commit ce0ec02c03
10 changed files with 599 additions and 0 deletions
@@ -0,0 +1,25 @@
//===----------------------------------------------------------------------===
//
// This source file is part of the MarvelService open source project
//
// Copyright (c) -2025 Röck+Cöde VoF. and the MarvelService project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE for license information
// See CONTRIBUTORS for the list of MarvelService project authors
//
//===----------------------------------------------------------------------===
import struct Foundation.TimeInterval
extension TimeInterval {
// MARK: Functions
/// Converts a time interval to a string value.
/// - Returns: A time interval as a string.
var asString: String {
.init(format: "%f", self)
}
}