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:
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===
|
||||
|
||||
extension String {
|
||||
/// A namespace assigned for Marvel API key samples.
|
||||
enum Key {
|
||||
/// A Marvel API private key sample.
|
||||
static let `private` = "SomePrivateKey"
|
||||
/// A Marvel API public key sample.
|
||||
static let `public` = "SomePublicKey"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
//===----------------------------------------------------------------------===
|
||||
//
|
||||
// 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 Testing
|
||||
|
||||
extension Tag {
|
||||
|
||||
// MARK: Constants
|
||||
|
||||
/// A flag that indicates tests for a type extension.
|
||||
@Tag static var `extension`: Self
|
||||
|
||||
/// A flag that indicates tests for a middleware type.
|
||||
@Tag static var middleware: Self
|
||||
|
||||
/// A flag that indicates tests for a use case type.
|
||||
@Tag static var useCase: Self
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
//===----------------------------------------------------------------------===
|
||||
//
|
||||
// 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.Date
|
||||
import struct Foundation.TimeInterval
|
||||
|
||||
/// A namespace assigned for input arguments on test cases.
|
||||
enum Input {
|
||||
|
||||
// MARK: Constants
|
||||
|
||||
/// A list of timestamps samples.
|
||||
static let timestamps: [TimeInterval] = [
|
||||
Date(timeIntervalSince1970: 0).timeIntervalSince1970,
|
||||
Date(timeIntervalSince1970: 1_000).timeIntervalSince1970,
|
||||
Date(timeIntervalSince1970: 1_000_000).timeIntervalSince1970,
|
||||
Date(timeIntervalSince1970: 1_000_000_000).timeIntervalSince1970,
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
//===----------------------------------------------------------------------===
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===
|
||||
|
||||
/// A namespace assigned for output arguments on test cases, that are expected results.
|
||||
enum Output {}
|
||||
Reference in New Issue
Block a user