Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 08b7fb1

Browse files
committed
initial commit
0 parents  commit 08b7fb1

64 files changed

Lines changed: 5826 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
.build/
3+
.swiftpm/
4+
BuildFiles/
5+
DerivedData/
6+
xcuserdata/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2021 Colaski
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

NOTICE.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# NOTICES AND INFORMATION
2+
This software incorporates material from third parties.
3+
4+
5+
## SwiftyJSON.swift
6+
7+
### SwiftyJSON
8+
9+
**Source:** https://github.com/SwiftyJSON/SwiftyJSON
10+
11+
The MIT License (MIT)
12+
13+
Copyright (c) 2017 Ruoyu Fu
14+
15+
Permission is hereby granted, free of charge, to any person obtaining a copy
16+
of this software and associated documentation files (the "Software"), to deal
17+
in the Software without restriction, including without limitation the rights
18+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19+
copies of the Software, and to permit persons to whom the Software is
20+
furnished to do so, subject to the following conditions:
21+
22+
The above copyright notice and this permission notice shall be included in
23+
all copies or substantial portions of the Software.
24+
25+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31+
THE SOFTWARE.

Package.resolved

Lines changed: 97 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// swift-tools-version:5.5
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "SwAuth",
8+
products: [
9+
.library(name: "SwAuth", targets: ["SwAuth"]),
10+
],
11+
dependencies: [
12+
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", from: "4.2.2"),
13+
.package(url: "https://github.com/EFPrefix/EFQRCode.git", .upToNextMinor(from: "6.1.0")),
14+
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.0.0")
15+
],
16+
targets: [
17+
.target(name: "SwAuth", dependencies: [
18+
"KeychainAccess",
19+
"EFQRCode",
20+
.product(name: "AsyncHTTPClient", package: "async-http-client")
21+
]),
22+
.testTarget(name: "SwAuthTests", dependencies: ["SwAuth"])
23+
]
24+
)

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SwAuth
2+
3+
SwAuth is a OAuth 2.0 library for iOS 15.0+, macOS 12.0+, watchOS 8.0+, and tvOS 15.0+ written in Swift.
4+
5+
## Features
6+
7+
- [x] Usable and beautiful syntax with async/await! Say goodbye to completion handler hell!
8+
- [x] Authorization Code Grant (RFC 6749/6750), Proof Key for Code Exchange (PKCE) extension for Authorization Code Grant (RFC 7636), and the Device Authorization Grant (RFC 8628).
9+
- [x] Support for all Apple platforms.
10+
- [x] Retry errored requests.
11+
- [x] Built on [SwiftNIO](https://github.com/apple/swift-nio) with [AsyncHTTPClient](https://github.com/swift-server/async-http-client). (Suck it URLSession)
12+
- [x] [Complete. Meticulous. Thorough. documentation 😰.](https://swauth.netlify.app/documentation/Swauth)
13+
- [x] Device Authorization QR Code for tvOS/watchOS.
14+
- [x] Easily integrate with SwiftUI.
15+
- [x] Sample/Example Apps.
16+
- [x] Automatically refresh tokens.
17+
- [x] Tokens securely stored on the Keychain.
18+
- [x] Easily deal with JSON responses.
19+
- [x] Useful errors (mostly).
20+
21+
## Requirments
22+
23+
- Xcode 13+
24+
- iOS 15.0+ | macOS 12.0+ | watchOS 8.0+ | tvOS 15.0+
25+
26+
## Installation/Integration
27+
28+
Use the Swift Package Manager to add SwAuth to your project! Simply add the package to your dependencies in your `Package.swift`:
29+
30+
```swift
31+
let package = Package(
32+
name: "YOUR_PROJECT_NAME",
33+
dependencies: [
34+
.package(url: "https://github.com/Colaski/SwAuth.git", from: "1.0.0"),
35+
]
36+
)
37+
```
38+
39+
## Usage
40+
41+
1. Import SwAuth in files you wish to use it's amazing features:
42+
```swift
43+
import SwAuth
44+
```
45+
46+
2. Read the docs 🤣 [https://swauth.netlify.app/documentation/Swauth](https://swauth.netlify.app/documentation/Swauth)

0 commit comments

Comments
 (0)