mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-16 11:22:34 +01:00
b4a862d207
# Conflicts: # Frameworks/Account/Account.swift # Frameworks/Account/Account.xcodeproj/project.pbxproj # NetNewsWire.xcodeproj/project.pbxproj # submodules/RSCore
37 lines
873 B
Swift
37 lines
873 B
Swift
//
|
|
// 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)
|
|
}
|
|
|
|
public enum CredentialsType: String {
|
|
case basic = "password"
|
|
case feedWranglerBasic = "feedWranglerBasic"
|
|
case feedWranglerToken = "feedWranglerToken"
|
|
case readerBasic = "readerBasic"
|
|
case readerAPIKey = "readerAPIKey"
|
|
case oauthAccessToken = "oauthAccessToken"
|
|
case oauthRefreshToken = "oauthRefreshToken"
|
|
}
|
|
|
|
public struct Credentials: Equatable {
|
|
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
|
|
}
|
|
}
|