Skip to content

Commit e09ad61

Browse files
authored
Feature/authentication integration (#6)
* Feature/readme (#5) * added logo and fixed badges * Added Feature List * Update macOS.yml * Update arm.yml * Update arm.yml * added authentication parsing * setting up server * cleaning up code * refactoring authentication * refactoring authentication * refactoring authentication * refactoring authentication * refactored HTTPServer * removed MKResult * fixing code factor trailing spaces * fixing white space issues
1 parent 7f71e07 commit e09ad61

30 files changed

Lines changed: 558 additions & 705 deletions

.github/workflows/arm.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: arm
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- main
47

58
jobs:
69
build:

.github/workflows/macOS.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- '*'
7+
- 'feature/*'
8+
- 'release/*'
79

810
jobs:
911
build:

Documentation/Reference/classes/MKURLBuilder.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ public let tokenEncoder: MKTokenEncoder?
1919
public let connection: MKDatabaseConnection
2020
```
2121

22-
### `webAuthenticationToken`
22+
### `tokenManager`
2323

2424
```swift
25-
public var webAuthenticationToken: String?
25+
public let tokenManager: MKTokenManager?
2626
```
2727

2828
## Methods
29-
### `init(tokenEncoder:connection:webAuthenticationToken:)`
29+
### `init(tokenEncoder:connection:tokenManager:)`
3030

3131
```swift
32-
public init(tokenEncoder: MKTokenEncoder?, connection: MKDatabaseConnection, webAuthenticationToken: String? = nil)
32+
public init(tokenEncoder: MKTokenEncoder?, connection: MKDatabaseConnection, tokenManager: MKTokenManager? = nil)
3333
```
3434

3535
### `url(withPathComponents:)`

Documentation/Reference/enums/MKError.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ public enum MKError: Error
77
```
88

99
## Cases
10+
### `authenticationRequired(_:)`
11+
12+
```swift
13+
case authenticationRequired(MKAuthenticationRedirect)
14+
```
15+
1016
### `noDataFromStatus(_:)`
1117

1218
```swift
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
**EXTENSION**
2+
3+
# `MKAuthenticationResponse`
4+
```swift
5+
extension MKAuthenticationResponse: MKAuthenticationRedirect
6+
```
7+
8+
## Properties
9+
### `url`
10+
11+
```swift
12+
public var url: URL
13+
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
**PROTOCOL**
2+
3+
# `MKAuthenticationRedirect`
4+
5+
```swift
6+
public protocol MKAuthenticationRedirect
7+
```
8+
9+
## Properties
10+
### `url`
11+
12+
```swift
13+
var url: URL
14+
```
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
**PROTOCOL**
2+
3+
# `MKTokenManager`
4+
5+
```swift
6+
public protocol MKTokenManager: AnyObject
7+
```
8+
9+
## Properties
10+
### `webAuthenticationToken`
11+
12+
```swift
13+
var webAuthenticationToken: String?
14+
```
15+
16+
## Methods
17+
### `request(_:_:)`
18+
19+
```swift
20+
func request(_ request: MKAuthenticationResponse?, _ callback: @escaping (Result<String, Error>) -> Void)
21+
```

Documentation/Reference/structs/AppleUserRequest.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

Documentation/Reference/structs/MKErrorResponse.md renamed to Documentation/Reference/structs/MKAuthenticationResponse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
**STRUCT**
22

3-
# `MKErrorResponse`
3+
# `MKAuthenticationResponse`
44

55
```swift
6-
public struct MKErrorResponse: Codable
6+
public struct MKAuthenticationResponse: MKDecodable
77
```
88

99
## Properties

Documentation/Reference/structs/MKDatabase.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,24 @@ public struct MKDatabase<HttpClient: MKHttpClient>
77
```
88

99
## Methods
10-
### `init(connection:factory:client:authenticationToken:)`
10+
### `setWebAuthenticationToken(_:)`
1111

1212
```swift
13-
public init(connection: MKDatabaseConnection, factory: MKURLBuilderFactory? = nil, client: HttpClient, authenticationToken: String? = nil)
13+
public nonmutating func setWebAuthenticationToken(_ newValue: String)
1414
```
1515

16-
### `perform(request:_:)`
16+
### `init(connection:factory:client:tokenManager:)`
17+
18+
```swift
19+
public init(connection: MKDatabaseConnection, factory: MKURLBuilderFactory? = nil, client: HttpClient, tokenManager: MKTokenManager? = nil)
20+
```
21+
22+
### `perform(request:returnFailedAuthentication:_:)`
1723

1824
```swift
1925
public func perform<RequestType: MKRequest, ResponseType>(
2026
request: RequestType,
27+
returnFailedAuthentication: Bool = false,
2128
_ callback: @escaping ((Result<ResponseType, Error>) -> Void)
2229
) where RequestType.Response == ResponseType
2330
```

0 commit comments

Comments
 (0)