2019-09-08 11:28:43 +02:00
|
|
|
//
|
|
|
|
// Credentials.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 12/9/17.
|
|
|
|
// Copyright © 2017 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
public enum CredentialsError: Error {
|
|
|
|
case incompleteCredentials
|
|
|
|
case unhandledError(status: OSStatus)
|
|
|
|
}
|
|
|
|
|
2019-09-15 17:03:47 +02:00
|
|
|
public enum CredentialsType: String {
|
|
|
|
case basic = "password"
|
2019-09-28 06:44:58 +02:00
|
|
|
case feedWranglerBasic = "feedWranglerBasic"
|
|
|
|
case feedWranglerToken = "feedWranglerToken"
|
2020-03-10 04:26:11 +01:00
|
|
|
case newsBlurBasic = "newsBlurBasic"
|
|
|
|
case newsBlurSessionId = "newsBlurSessionId"
|
2019-09-15 17:03:47 +02:00
|
|
|
case readerBasic = "readerBasic"
|
|
|
|
case readerAPIKey = "readerAPIKey"
|
|
|
|
case oauthAccessToken = "oauthAccessToken"
|
2020-04-14 17:15:24 +02:00
|
|
|
case oauthAccessTokenSecret = "oauthAccessTokenSecret"
|
2019-09-15 17:03:47 +02:00
|
|
|
case oauthRefreshToken = "oauthRefreshToken"
|
2019-09-08 11:28:43 +02:00
|
|
|
}
|
|
|
|
|
2019-11-07 08:54:41 +01:00
|
|
|
public struct Credentials: Equatable {
|
2019-09-15 17:03:47 +02:00
|
|
|
public let type: CredentialsType
|
|
|
|
public let username: String
|
|
|
|
public let secret: String
|
|
|
|
|
|
|
|
public init(type: CredentialsType, username: String, secret: String) {
|
|
|
|
self.type = type
|
|
|
|
self.username = username
|
|
|
|
self.secret = secret
|
|
|
|
}
|
|
|
|
}
|