-
Notifications
You must be signed in to change notification settings - Fork 91
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
Fix missing partial crypto functionality #89
Changes from all commits
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 |
---|---|---|
|
@@ -79,6 +79,8 @@ class PubNub implements LoggerAwareInterface | |
/** @var int $nextSequence */ | ||
protected $nextSequence = 0; | ||
|
||
protected ?CryptoModule $cryptoModule = null; | ||
|
||
/** | ||
* PNConfiguration constructor. | ||
* | ||
|
@@ -557,4 +559,18 @@ public function setToken($token) | |
{ | ||
return $this->tokenManager->setToken($token); | ||
} | ||
|
||
public function getCrypto(): CryptoModule | ||
{ | ||
if ($this->cryptoModule) { | ||
return $this->cryptoModule; | ||
} else { | ||
return $this->configuration->getCrypto(); | ||
} | ||
} | ||
|
||
public function setCrypto(CryptoModule $cryptoModule) | ||
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. FYI. In Kotlin/Java it is not possible to setCrypto in PubNub. User can setCrypto only in PNConfiguration. 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. As I understood @techwritermat asked for that - maybe he will ask you too ;o |
||
{ | ||
$this->cryptoModule = $cryptoModule; | ||
} | ||
} |
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.
Is this line creates a new cryptomodule on missing?
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.
if it has the cipher keyset up in config then will get the module. Else it raises an exception