Skip to content

Commit

Permalink
Swapping parameter order of group and service
Browse files Browse the repository at this point in the history
  • Loading branch information
mergesort committed Sep 18, 2023
1 parent a386031 commit 57c64c9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/Boutique/SecurelyStoredValue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ public struct SecurelyStoredValue<Item: Codable> {
private let cancellableBox = CancellableBox()
private let itemSubject = CurrentValueSubject<Item?, Never>(nil)
private let key: String
private let group: String?
private let service: String?
private let group: String?

public init(key: String, group: KeychainGroup? = nil, service: KeychainService? = nil) {
public init(key: String, service: KeychainService? = nil, group: KeychainGroup? = nil) {
self.key = key
self.group = group?.value
self.service = service?.value
self.group = group?.value
}

/// The currently stored value
public var wrappedValue: Item? {
Self.storedValue(service: self.keychainService, account: self.key, group: self.group)
Self.storedValue(group: self.group, service: self.keychainService, account: self.key)
}

/// A ``SecurelyStoredValue`` which exposes ``set(_:)`` and ``remove()`` functions alongside a ``publisher``.
Expand Down Expand Up @@ -151,7 +151,7 @@ public struct SecurelyStoredValue<Item: Codable> {
}

private extension SecurelyStoredValue {
static func storedValue(service: String, account: String, group: String?) -> Item? {
static func storedValue(group: String?, service: String, account: String) -> Item? {
let keychainQuery = [
kSecClass: kSecClassGenericPassword,
kSecAttrService: service,
Expand Down

0 comments on commit 57c64c9

Please sign in to comment.