I am seeing the following warnings in the following snippet:
import Fluent
import JWT
import Vapor
struct VidaLifeTokenPayload: JWTPayload, Sendable {
/**
Maps the longer Swift property names to the
shortened keys used in the JWT payload.
*/
enum CodingKeys: String, CodingKey {
case subject = "sub"
case expiration = "exp"
case userID = "uid"
case refreshToken = "rtok"
}
/**
The "sub" (subject) claim identifies the principal that is the
subject of the JWT.
*/
let subject: SubjectClaim = "MyApp" <<<<< Stored property 'subject' of 'Sendable'-conforming struct 'VidaLifeTokenPayload' has non-sendable type 'SubjectClaim'
/**
The "exp" (expiration time) claim identifies the expiration time on
or after which the JWT MUST NOT be accepted for processing.
*/
let expiration = ExpirationClaim(value: Date().addingTimeInterval(15 * 60)) <<<<< Stored property 'expiration' of 'Sendable'-conforming struct 'VidaLifeTokenPayload' has non-sendable type 'ExpirationClaim'
var userID: UUID
var refreshToken: String
init(
userID: UUID,
refreshToken: String
) {
self.userID = userID
self.refreshToken = refreshToken
}
/**
Run any additional verification logic beyond signature verification here.
Since we have an ExpirationClaim, we will call its verify method.
*/
func verify(using _: JWTSigner) throws {
try expiration.verifyNotExpired()
}
}
I get the feeling this is coming from JWT, but I'm not sure 100%.
to @jade ruin, who now has 1105