2020-07-30 01:50:30 +02:00
|
|
|
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
|
|
|
|
import Foundation
|
2020-08-31 01:33:11 +02:00
|
|
|
import Mastodon
|
2020-07-30 01:50:30 +02:00
|
|
|
|
|
|
|
extension AppAuthorizationEndpoint: Stubbing {
|
|
|
|
func dataString(url: URL) -> String? {
|
|
|
|
switch self {
|
|
|
|
case let .apps(clientName, redirectURI, _, _):
|
|
|
|
return """
|
|
|
|
{
|
|
|
|
"id": "\(Int.random(in: 100000...999999))",
|
|
|
|
"name": "\(clientName)",
|
|
|
|
"website": null,
|
|
|
|
"redirect_uri": "\(redirectURI)",
|
|
|
|
"client_id": "AUTHORIZATION_CLIENT_ID_STUB_VALUE",
|
|
|
|
"client_secret": "AUTHORIZATION_CLIENT_SECRET_STUB_VALUE",
|
|
|
|
"vapid_key": "AUTHORIZATION_VAPID_KEY_STUB_VALUE"
|
|
|
|
}
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|