-
-
Notifications
You must be signed in to change notification settings - Fork 152
Add Basic Windows & Linux Support #184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
be0e50a
Seems to compile and sort of run tests
brianmichel 4807c7e
Fix a few more issues
brianmichel e36d3b6
Fix naming and unneeded import
brianmichel ae2d272
Get CI a little further
brianmichel 85064a8
Use platform specific snapshots
brianmichel 4ae07d7
More snapshots
brianmichel 448d0f2
Try again with non-Darwin
brianmichel 24499b7
Turns out we just need a darwin and non-darwin snapshots dir
brianmichel c01a57c
Fix header look up for client creation
brianmichel aca8534
update ci configuration
brianmichel c7bb863
Skip problematic test on Windows and Linux
brianmichel 83b93ad
Use a supported version of Swift for the linux CI
brianmichel ce5ed7f
Go back to specific folders for each platform, it's just easier to de…
brianmichel 672b583
Attempt to disable conversion and skip broken test
brianmichel 00b5592
Cleaning up the PR a little
brianmichel a8883c6
Add missing test files
brianmichel fdaad65
Update tests
brianmichel 638091d
Address some PR feedback
brianmichel bfc9620
Recomment out test
brianmichel 1e382ec
Drop down to see if using a Semaphore works across platforms
brianmichel 8921a7c
Allow threading in a local storage client
brianmichel 13cd94d
Remove defaults from designated initializer and put defaults in platf…
brianmichel bcf8ccf
Give linux a convenience init so tests can use it
brianmichel 73abf4d
Remove default local storage
brianmichel e938502
Fix mock generation
brianmichel e027681
Remove old tests
brianmichel d6cb996
Remove autocanonicalization problems by making Apikey consistent casing.
brianmichel 609ca57
Re-record all snapshots to prevent auto-canonicalization issues acros…
brianmichel 3970e3d
Turn on autocrlf to see if that gets the test snapshots further
brianmichel 60d9d88
fix line endings for snapshots
brianmichel ecf5835
fix initializer
brianmichel 44a2aaf
Remove unneeded testing workaround
brianmichel 300f82f
Update tests to use empty response where needed
brianmichel 08abb80
Fix empty implementation to work across platforms
brianmichel d093cef
Fix test that breaks to only run if not Windows or Linux
brianmichel 2a96bc6
use correct operator
brianmichel e28cb4e
Fix binary packaging
brianmichel af527e6
Use URLs and remove convenience
brianmichel 03e7b74
Fix cancellation
brianmichel f20c806
fix example
brianmichel 0f9be90
Fix actuallyCancel logic
brianmichel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/Tests/**/__Snapshots__/**/*.txt eol=lf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"cSpell.words": [ | ||
"apikey", | ||
"HTTPURL", | ||
"pkce", | ||
"postgrest", | ||
"preconcurrency", | ||
"Supabase", | ||
"whitespaces", | ||
"xctest" | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Foundation | ||
|
||
// Borrowed from the Vapor project, https://github.com/vapor/vapor/blob/main/Sources/Vapor/Utilities/Array%2BRandom.swift#L14 | ||
extension FixedWidthInteger { | ||
internal static func random() -> Self { | ||
return Self.random(in: .min ... .max) | ||
} | ||
|
||
internal static func random<T>(using generator: inout T) -> Self | ||
where T : RandomNumberGenerator | ||
{ | ||
return Self.random(in: .min ... .max, using: &generator) | ||
} | ||
} | ||
|
||
extension Array where Element: FixedWidthInteger { | ||
internal static func random(count: Int) -> [Element] { | ||
var array: [Element] = .init(repeating: 0, count: count) | ||
(0..<count).forEach { array[$0] = Element.random() } | ||
return array | ||
} | ||
|
||
internal static func random<T>(count: Int, using generator: inout T) -> [Element] | ||
where T: RandomNumberGenerator | ||
{ | ||
var array: [Element] = .init(repeating: 0, count: count) | ||
(0..<count).forEach { array[$0] = Element.random(using: &generator) } | ||
return array | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import Foundation | ||
import KeychainAccess | ||
@_spi(Internal) import _Helpers | ||
|
||
struct SessionRefresher: Sendable { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Foundation | ||
|
||
public protocol AuthLocalStorage: Sendable { | ||
func store(key: String, value: Data) throws | ||
func retrieve(key: String) throws -> Data? | ||
func remove(key: String) throws | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#if !os(Windows) && !os(Linux) | ||
import Foundation | ||
@preconcurrency import KeychainAccess | ||
|
||
public struct KeychainLocalStorage: AuthLocalStorage { | ||
private let keychain: Keychain | ||
|
||
public init(service: String, accessGroup: String?) { | ||
if let accessGroup { | ||
keychain = Keychain(service: service, accessGroup: accessGroup) | ||
} else { | ||
keychain = Keychain(service: service) | ||
} | ||
} | ||
|
||
public func store(key: String, value: Data) throws { | ||
try keychain.set(value, key: key) | ||
} | ||
|
||
public func retrieve(key: String) throws -> Data? { | ||
try keychain.getData(key) | ||
} | ||
|
||
public func remove(key: String) throws { | ||
try keychain.remove(key) | ||
} | ||
} | ||
#endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.