Read-only for now, per instruction to defer key creation/revocation. Both confirmed against live network captures.
34 lines
992 B
Swift
34 lines
992 B
Swift
import Foundation
|
|
|
|
/// A personal API key (Settings → API & Access). Only the last 4 characters
|
|
/// of the actual token are ever returned by the server — there's no way to
|
|
/// see a full key again after creation, matching every other API-key UI
|
|
/// convention.
|
|
public struct OutlineAPIKey: Codable, Identifiable, Hashable, Sendable {
|
|
public let id: String
|
|
public let name: String
|
|
public let last4: String?
|
|
public let scope: [String]?
|
|
public let createdAt: Date
|
|
public let expiresAt: Date?
|
|
public let lastActiveAt: Date?
|
|
|
|
public init(
|
|
id: String,
|
|
name: String,
|
|
last4: String? = nil,
|
|
scope: [String]? = nil,
|
|
createdAt: Date,
|
|
expiresAt: Date? = nil,
|
|
lastActiveAt: Date? = nil
|
|
) {
|
|
self.id = id
|
|
self.name = name
|
|
self.last4 = last4
|
|
self.scope = scope
|
|
self.createdAt = createdAt
|
|
self.expiresAt = expiresAt
|
|
self.lastActiveAt = lastActiveAt
|
|
}
|
|
}
|