Skip to content

Commit 66450c6

Browse files
committed
Merge branch 'release/0.2.2'
2 parents bf81653 + 9e207f0 commit 66450c6

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## [Unreleased]
44

5+
## [0.2.2] - 2023-08-28Z
6+
* [#12](https://github.com/Blackjacx/ASCKit/pull/12): Add token subcommand to keys - [@Blackjacx](https://github.com/blackjacx).
7+
58
## [0.2.1] - 2023-08-24Z
69
* Add log to show which tester is processed - [@Blackjacx](https://github.com/blackjacx).
710

Sources/ASCKit/ASCService.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@ public struct ASCService {
5757

5858
// MARK: - Creating Access Token
5959

60-
static func createAccessToken() throws -> String {
60+
public static func createAccessToken(keyId: String? = specifiedKeyId) throws -> String {
6161

6262
let key: ApiKey
6363

6464
// Prefer key specified via parameter over activated one
65-
if let specifiedKeyId = specifiedKeyId {
66-
guard let specifiedKey = apiKeys.first(where: { $0.id == specifiedKeyId }) else {
67-
throw AscError.apiKeyNotFound(specifiedKeyId)
65+
if let keyId {
66+
guard let matchingKey = apiKeys.first(where: { $0.id == keyId }) else {
67+
throw AscError.apiKeyNotFound(keyId)
6868
}
69-
key = specifiedKey
69+
key = matchingKey
7070
} else if let activeKey = apiKeys.first(where: { $0.isActive }) {
7171
// Go with active API key
7272
key = activeKey

0 commit comments

Comments
 (0)