Skip to content

Commit b2c85c9

Browse files
fpseverinoptoffyvamsii777
authored
Update to Swift 6 (#109)
- Update package to Swift 6 - Remove all `EventLoopFuture`s in favor of async/await - Update JWTKit to v5 - Update to Swift Testing - Adopt `swift-format` - Update CI * Update Keycloak.swift Co-authored-by: Paul Toffoloni <[email protected]> * Update Dropbox.swift Co-authored-by: Paul Toffoloni <[email protected]> * Update Discord.swift Co-authored-by: Paul Toffoloni <[email protected]> * Update FederatedService.swift Co-authored-by: Paul Toffoloni <[email protected]> * Update FederatedServiceRouter.swift Co-authored-by: Paul Toffoloni <[email protected]> * Update FederatedServiceRouter.swift Co-authored-by: Paul Toffoloni <[email protected]> * Update Auth0.swift Co-authored-by: Paul Toffoloni <[email protected]> * Update Sources/ImperialShopify/ShopifyRouter.swift Co-authored-by: Vamsi Madduluri <[email protected]> --------- Co-authored-by: Paul Toffoloni <[email protected]> Co-authored-by: Vamsi Madduluri <[email protected]>
1 parent e88cb7e commit b2c85c9

File tree

113 files changed

+1821
-1845
lines changed

Some content is hidden

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

113 files changed

+1821
-1845
lines changed

.env.testing

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
AUTH0_DOMAIN=test
2+
AUTH0_CLIENT_ID=test
3+
AUTH0_CLIENT_SECRET=test
4+
5+
DEVIANTART_CLIENT_ID=test
6+
DEVIANTART_CLIENT_SECRET=test
7+
8+
DISCORD_CLIENT_ID=test
9+
DISCORD_CLIENT_SECRET=test
10+
11+
DROPBOX_CLIENT_ID=test
12+
DROPBOX_CLIENT_SECRET=test
13+
14+
FACEBOOK_CLIENT_ID=test
15+
FACEBOOK_CLIENT_SECRET=test
16+
17+
GITHUB_CLIENT_ID=test
18+
GITHUB_CLIENT_SECRET=test
19+
20+
GITLAB_CLIENT_ID=test
21+
GITLAB_CLIENT_SECRET=test
22+
23+
GOOGLE_CLIENT_ID=test
24+
GOOGLE_CLIENT_SECRET=test
25+
26+
GOOGLEJWT_CLIENT_EMAIL=test
27+
GOOGLEJWT_CLIENT_SECRET=test
28+
29+
IMGUR_CLIENT_ID=test
30+
IMGUR_CLIENT_SECRET=test
31+
32+
KEYCLOAK_CLIENT_ID=test
33+
KEYCLOAK_CLIENT_SECRET=test
34+
KEYCLOAK_ACCESS_TOKEN_URL=test
35+
KEYCLOAK_AUTH_URL=test
36+
37+
MICROSOFT_CLIENT_ID=test
38+
MICROSOFT_CLIENT_SECRET=test
39+
40+
MIXCLOUD_CLIENT_ID=test
41+
MIXCLOUD_CLIENT_SECRET=test
42+
43+
SHOPIFY_CLIENT_ID=test
44+
SHOPIFY_CLIENT_SECRET=test

.github/workflows/test.yml

+12-46
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,15 @@
11
name: test
2+
concurrency:
3+
group: ${{ github.workflow }}-${{ github.ref }}
4+
cancel-in-progress: true
25
on:
3-
push:
4-
branches: [ main ]
5-
pull_request:
6-
branches: [ main ]
7-
6+
pull_request: { types: [opened, reopened, synchronize, ready_for_review] }
7+
push: { branches: [ main ] }
8+
89
jobs:
9-
macos:
10-
strategy:
11-
fail-fast: false
12-
matrix:
13-
xcode: [latest, latest-stable]
14-
runs-on: macos-latest
15-
steps:
16-
- name: Select latest available Xcode
17-
uses: maxim-lobanov/[email protected]
18-
with: { 'xcode-version': '${{ matrix.xcode }}' }
19-
- name: Check out code
20-
uses: actions/checkout@v2
21-
- name: Run tests with Thread Sanitizer
22-
run: swift test --enable-test-discovery --sanitize=thread
23-
linux:
24-
strategy:
25-
fail-fast: false
26-
matrix:
27-
swiftver:
28-
- swift:5.2
29-
- swift:5.3
30-
swiftos:
31-
- xenial
32-
- bionic
33-
- focal
34-
- centos7
35-
- centos8
36-
- amazonlinux2
37-
container: ${{ format('{0}-{1}', matrix.swiftver, matrix.swiftos) }}
38-
runs-on: ubuntu-latest
39-
steps:
40-
- name: SPM is incompatible with CentOS 7
41-
if: ${{ matrix.swiftos == 'centos7' }}
42-
run: |
43-
yum install -y make libcurl-devel
44-
git clone https://github.com/git/git -bv2.28.0 --depth 1 && cd git
45-
make prefix=/usr -j all install NO_OPENSSL=1 NO_EXPAT=1 NO_TCLTK=1 NO_GETTEXT=1 NO_PERL=1
46-
- name: Check out code
47-
uses: actions/checkout@v2
48-
- name: Run tests with Thread Sanitizer
49-
run: swift test --enable-test-discovery --sanitize=thread
10+
unit-tests:
11+
uses: vapor/ci/.github/workflows/run-unit-tests.yml@main
12+
with:
13+
with_linting: true
14+
secrets:
15+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.spi.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 1
2+
builder:
3+
configs:
4+
- documentation_targets:
5+
- ImperialCore
6+
- ImperialAuth0
7+
- ImperialDeviantArt
8+
- ImperialDiscord
9+
- ImperialDropbox
10+
- ImperialFacebook
11+
- ImperialGitHub
12+
- ImperialGitlab
13+
- ImperialGoogle
14+
- ImperialImgur
15+
- ImperialKeycloak
16+
- ImperialMicrosoft
17+
- ImperialMixcloud
18+
- ImperialShopify

.swift-format

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"fileScopedDeclarationPrivacy": {
3+
"accessLevel": "private"
4+
},
5+
"indentation": {
6+
"spaces": 4
7+
},
8+
"indentConditionalCompilationBlocks": true,
9+
"indentSwitchCaseLabels": false,
10+
"lineBreakAroundMultilineExpressionChainComponents": false,
11+
"lineBreakBeforeControlFlowKeywords": false,
12+
"lineBreakBeforeEachArgument": false,
13+
"lineBreakBeforeEachGenericRequirement": false,
14+
"lineLength": 140,
15+
"maximumBlankLines": 1,
16+
"multiElementCollectionTrailingCommas": true,
17+
"noAssignmentInExpressions": {
18+
"allowedFunctions": [
19+
"XCTAssertNoThrow"
20+
]
21+
},
22+
"prioritizeKeepingFunctionOutputTogether": false,
23+
"respectsExistingLineBreaks": true,
24+
"rules": {
25+
"AllPublicDeclarationsHaveDocumentation": false,
26+
"AlwaysUseLiteralForEmptyCollectionInit": false,
27+
"AlwaysUseLowerCamelCase": true,
28+
"AmbiguousTrailingClosureOverload": true,
29+
"BeginDocumentationCommentWithOneLineSummary": false,
30+
"DoNotUseSemicolons": true,
31+
"DontRepeatTypeInStaticProperties": true,
32+
"FileScopedDeclarationPrivacy": true,
33+
"FullyIndirectEnum": true,
34+
"GroupNumericLiterals": true,
35+
"IdentifiersMustBeASCII": true,
36+
"NeverForceUnwrap": false,
37+
"NeverUseForceTry": false,
38+
"NeverUseImplicitlyUnwrappedOptionals": false,
39+
"NoAccessLevelOnExtensionDeclaration": true,
40+
"NoAssignmentInExpressions": true,
41+
"NoBlockComments": true,
42+
"NoCasesWithOnlyFallthrough": true,
43+
"NoEmptyTrailingClosureParentheses": true,
44+
"NoLabelsInCasePatterns": true,
45+
"NoLeadingUnderscores": false,
46+
"NoParensAroundConditions": true,
47+
"NoPlaygroundLiterals": true,
48+
"NoVoidReturnOnFunctionSignature": true,
49+
"OmitExplicitReturns": false,
50+
"OneCasePerLine": true,
51+
"OneVariableDeclarationPerLine": true,
52+
"OnlyOneTrailingClosureArgument": true,
53+
"OrderedImports": true,
54+
"ReplaceForEachWithForLoop": true,
55+
"ReturnVoidInsteadOfEmptyTuple": true,
56+
"TypeNamesShouldBeCapitalized": true,
57+
"UseEarlyExits": false,
58+
"UseExplicitNilCheckInConditions": true,
59+
"UseLetInEveryBoundCaseVariable": true,
60+
"UseShorthandTypeNames": true,
61+
"UseSingleLinePropertyGetter": true,
62+
"UseSynthesizedInitializer": true,
63+
"UseTripleSlashForDocumentationComments": true,
64+
"UseWhereClausesInForLoops": false,
65+
"ValidateDocumentationComments": false
66+
},
67+
"spacesAroundRangeFormationOperators": false,
68+
"tabWidth": 8,
69+
"version": 1
70+
}

Package.swift

+66-28
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,97 @@
1-
// swift-tools-version:5.2
1+
// swift-tools-version:6.0
22
import PackageDescription
33

44
let package = Package(
55
name: "Imperial",
66
platforms: [
7-
.macOS(.v10_15)
7+
.macOS(.v13)
88
],
99
products: [
1010
.library(name: "ImperialCore", targets: ["ImperialCore"]),
1111
.library(name: "ImperialAuth0", targets: ["ImperialCore", "ImperialAuth0"]),
12+
.library(name: "ImperialDeviantArt", targets: ["ImperialCore", "ImperialDeviantArt"]),
1213
.library(name: "ImperialDiscord", targets: ["ImperialCore", "ImperialDiscord"]),
1314
.library(name: "ImperialDropbox", targets: ["ImperialCore", "ImperialDropbox"]),
1415
.library(name: "ImperialFacebook", targets: ["ImperialCore", "ImperialFacebook"]),
1516
.library(name: "ImperialGitHub", targets: ["ImperialCore", "ImperialGitHub"]),
1617
.library(name: "ImperialGitlab", targets: ["ImperialCore", "ImperialGitlab"]),
1718
.library(name: "ImperialGoogle", targets: ["ImperialCore", "ImperialGoogle"]),
19+
.library(name: "ImperialImgur", targets: ["ImperialCore", "ImperialImgur"]),
1820
.library(name: "ImperialKeycloak", targets: ["ImperialCore", "ImperialKeycloak"]),
1921
.library(name: "ImperialMicrosoft", targets: ["ImperialCore", "ImperialMicrosoft"]),
22+
.library(name: "ImperialMixcloud", targets: ["ImperialCore", "ImperialMixcloud"]),
2023
.library(name: "ImperialShopify", targets: ["ImperialCore", "ImperialShopify"]),
21-
.library(name: "Imperial", targets: [
22-
"ImperialCore",
23-
"ImperialAuth0",
24-
"ImperialDiscord",
25-
"ImperialDropbox",
26-
"ImperialFacebook",
27-
"ImperialGitHub",
28-
"ImperialGitlab",
29-
"ImperialGoogle",
30-
"ImperialKeycloak",
31-
"ImperialMicrosoft",
32-
"ImperialShopify"
33-
]),
24+
.library(
25+
name: "Imperial",
26+
targets: [
27+
"ImperialCore",
28+
"ImperialAuth0",
29+
"ImperialDeviantArt",
30+
"ImperialDiscord",
31+
"ImperialDropbox",
32+
"ImperialFacebook",
33+
"ImperialGitHub",
34+
"ImperialGitlab",
35+
"ImperialGoogle",
36+
"ImperialImgur",
37+
"ImperialKeycloak",
38+
"ImperialMicrosoft",
39+
"ImperialMixcloud",
40+
"ImperialShopify",
41+
]),
3442
],
3543
dependencies: [
3644
.package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"),
37-
.package(url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0")
45+
.package(url: "https://github.com/vapor/jwt-kit.git", from: "5.0.0"),
3846
],
3947
targets: [
4048
.target(
4149
name: "ImperialCore",
4250
dependencies: [
4351
.product(name: "Vapor", package: "vapor"),
4452
.product(name: "JWTKit", package: "jwt-kit"),
45-
]
53+
],
54+
swiftSettings: swiftSettings
55+
),
56+
.target(name: "ImperialAuth0", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
57+
.target(name: "ImperialDeviantArt", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
58+
.target(name: "ImperialDiscord", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
59+
.target(name: "ImperialDropbox", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
60+
.target(name: "ImperialFacebook", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
61+
.target(name: "ImperialGitHub", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
62+
.target(name: "ImperialGitlab", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
63+
.target(name: "ImperialGoogle", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
64+
.target(name: "ImperialImgur", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
65+
.target(name: "ImperialKeycloak", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
66+
.target(name: "ImperialMicrosoft", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
67+
.target(name: "ImperialMixcloud", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
68+
.target(name: "ImperialShopify", dependencies: ["ImperialCore"], swiftSettings: swiftSettings),
69+
.testTarget(
70+
name: "ImperialTests",
71+
dependencies: [
72+
.target(name: "ImperialCore"),
73+
.target(name: "ImperialAuth0"),
74+
.target(name: "ImperialDeviantArt"),
75+
.target(name: "ImperialDiscord"),
76+
.target(name: "ImperialDropbox"),
77+
.target(name: "ImperialFacebook"),
78+
.target(name: "ImperialGitHub"),
79+
.target(name: "ImperialGitlab"),
80+
.target(name: "ImperialGoogle"),
81+
.target(name: "ImperialImgur"),
82+
.target(name: "ImperialKeycloak"),
83+
.target(name: "ImperialMicrosoft"),
84+
.target(name: "ImperialMixcloud"),
85+
.target(name: "ImperialShopify"),
86+
.product(name: "XCTVapor", package: "vapor"),
87+
],
88+
swiftSettings: swiftSettings
4689
),
47-
.target(name: "ImperialAuth0", dependencies: ["ImperialCore"]),
48-
.target(name: "ImperialDiscord", dependencies: ["ImperialCore"]),
49-
.target(name: "ImperialDropbox", dependencies: ["ImperialCore"]),
50-
.target(name: "ImperialFacebook", dependencies: ["ImperialCore"]),
51-
.target(name: "ImperialGitHub", dependencies: ["ImperialCore"]),
52-
.target(name: "ImperialGitlab", dependencies: ["ImperialCore"]),
53-
.target(name: "ImperialGoogle", dependencies: ["ImperialCore"]),
54-
.target(name: "ImperialKeycloak", dependencies: ["ImperialCore"]),
55-
.target(name: "ImperialMicrosoft", dependencies: ["ImperialCore"]),
56-
.target(name: "ImperialShopify", dependencies: ["ImperialCore"]),
57-
.testTarget(name: "ImperialTests", dependencies: ["ImperialCore", "ImperialShopify"]),
5890
]
5991
)
92+
93+
var swiftSettings: [SwiftSetting] {
94+
[
95+
.enableUpcomingFeature("ExistentialAny")
96+
]
97+
}

README.md

+19-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
# Imperial
1+
<div align="center">
2+
<img src="https://avatars.githubusercontent.com/u/26165732?s=200&v=4" width="100" height="100" alt="avatar" />
3+
<h1>Imperial</h1>
4+
<a href="https://swiftpackageindex.com/vapor-community/Imperial/documentation">
5+
<img src="https://design.vapor.codes/images/readthedocs.svg" alt="Documentation">
6+
</a>
7+
<a href="https://discord.gg/vapor"><img src="https://design.vapor.codes/images/discordchat.svg" alt="Team Chat"></a>
8+
<a href="LICENSE"><img src="https://design.vapor.codes/images/mitlicense.svg" alt="MIT License"></a>
9+
<a href="https://github.com/vapor-community/Imperial/actions/workflows/test.yml">
10+
<img src="https://img.shields.io/github/actions/workflow/status/vapor-community/Imperial/test.yml?event=push&style=plastic&logo=github&label=tests&logoColor=%23ccc" alt="Continuous Integration">
11+
</a>
12+
<a href="https://codecov.io/github/vapor-community/Imperial">
13+
<img src="https://img.shields.io/codecov/c/github/vapor-community/Imperial?style=plastic&logo=codecov&label=codecov">
14+
</a>
15+
<a href="https://swift.org">
16+
<img src="https://design.vapor.codes/images/swift60up.svg" alt="Swift 6.0+">
17+
</a>
18+
</div>
19+
<br>
220

321
Imperial is a Federated Login service, allowing you to easily integrate your Vapor applications with OAuth providers to handle your apps authentication.
4-
5-
- [Usage Guides](https://github.com/vapor-community/Imperial/blob/master/docs)
6-
7-
## Attribution
8-
Author(s): @calebkleveter, @rafiki270
9-
10-
## License
11-
12-
All code contained in the Imperial package is under the [MIT](https://github.com/vapor-community/Imperial/blob/master/LICENSE) license agreement.

Sources/Imperial/Services/DeviantArt/DeviantArt.swift

-24
This file was deleted.

0 commit comments

Comments
 (0)