-
Notifications
You must be signed in to change notification settings - Fork 34
Midships 4.7.0 #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Midships 4.7.0 #320
Changes from all commits
e894681
94dd1b2
a0ec7cc
daccd0e
894c6b4
e2cc039
c05f05d
b6fa6e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,17 +12,17 @@ import Foundation | |
|
|
||
|
|
||
| /// TokenManager class is a management class responsible for persisting, retrieving, and refreshing OAuth2 token(s) | ||
| struct TokenManager { | ||
| public struct TokenManager { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please update the copyright header to reflect the latest changes year |
||
|
|
||
| var oAuth2Client: OAuth2Client | ||
| public var oAuth2Client: OAuth2Client | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add code doc for the public oAuth2Client |
||
| var keychainManager: KeychainManager | ||
|
|
||
| /// Initializes TokenMAnager instance with optional Access Group for shared Keychain Group identifier | ||
| /// | ||
| /// - Parameters: | ||
| /// - oAuth2Client: OAuth2Client instance for OAuth2 token protocols | ||
| /// - keychainManager: KeychainManager instance for secure credentials management | ||
| public init(oAuth2Client: OAuth2Client, keychainManager: KeychainManager) { | ||
| init(oAuth2Client: OAuth2Client, keychainManager: KeychainManager) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was public meant to be removed here? |
||
| self.oAuth2Client = oAuth2Client | ||
| self.keychainManager = keychainManager | ||
| } | ||
|
|
@@ -357,7 +357,7 @@ struct TokenManager { | |
|
|
||
|
|
||
| /// Clears all credentials locally as there is no more valid credentials to renew user's session | ||
| func clearCredentials() { | ||
| public func clearCredentials() { | ||
| self.keychainManager.cookieStore.deleteAll() | ||
| let _ = try? self.keychainManager.setAccessToken(token: nil) | ||
| self.keychainManager.setSSOToken(ssoToken: nil) | ||
|
|
@@ -366,6 +366,10 @@ struct TokenManager { | |
| Browser.currentBrowser = nil | ||
| } | ||
|
|
||
| public func persistToken(token: AccessToken) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add code doc for the persistToken method |
||
| let _ = try? self.keychainManager.setAccessToken(token: token) | ||
| } | ||
|
|
||
|
|
||
| /// Revoke given Access Token without using the Refresh Token | ||
| func revokeToken(_ token: AccessToken, completion: @escaping CompletionCallback) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the copyright header to reflect the latest changes year