-
Notifications
You must be signed in to change notification settings - Fork 102
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
Adds a new Provider for self-hosted atlassian #35
Adds a new Provider for self-hosted atlassian #35
Conversation
Bugs fixed. Though no new tests… As I coudln't find some examples for other OAuth1-Providers I didn't add some… |
src/OAuth1/Provider/Atlassian.php
Outdated
*/ | ||
public function oauthRequest($uri, $method = Client::GET, $parameters = []) | ||
{ | ||
error_log($uri); |
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.
Debug things should be removed
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.
ouch! Right! :(
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.
That method shouldn't be there in the first place as it is obsoleted by #36
|
||
public function __construct($private_key) | ||
{ | ||
if (! is_readable($private_key)) { |
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.
unexpected spaces
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.
where?
|
||
class MethodRSASHA1 extends AbstractSignatureMethod | ||
{ | ||
private $private_key; |
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.
not camelCase
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.
Editing…
src/OAuth1/AbstractProvider.php
Outdated
*/ | ||
protected $signature; | ||
|
||
|
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.
unneeded blank line
src/OAuth1/Provider/Atlassian.php
Outdated
<?php | ||
/** | ||
* SocialConnect project | ||
* @author: Patsura Dmitry https://github.com/ovr <talk@dmtry.me> |
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.
you @author
src/OAuth1/Provider/Atlassian.php
Outdated
*/ | ||
public function __construct(ClientInterface $httpClient, SessionInterface $session, Consumer $consumer, array $parameters) | ||
{ | ||
if (! isset($parameters['baseUri'])) { |
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 (! i
-> if (!i
- please remove unneeded space
src/OAuth1/Provider/Atlassian.php
Outdated
|
||
class Atlassian extends AbstractProvider | ||
{ | ||
private $baseUri; |
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.
blank line after private $baseUri;
and please doc block that it's a string
Thank
src/OAuth1/Provider/Atlassian.php
Outdated
); | ||
} | ||
|
||
$headers = $response->getHeader('X-AUSERNAME'); |
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.
$headers is unused, please remove it, thanks
src/OAuth1/Provider/Atlassian.php
Outdated
Client::GET, | ||
$parameters | ||
); | ||
while ($response->hasHeader('Location')) { |
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.
plank line before while
and btw, this while can be an infinity loop
if you are sure that attlasin can lag, maybe add retryCount, and retryMax? Thank
<?php | ||
/** | ||
* SocialConnect project | ||
* @author: Patsura Dmitry https://github.com/ovr <talk@dmtry.me> |
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.
You @author
|
||
public function __construct($privateKey) | ||
{ | ||
if (! is_readable($privateKey)) { |
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 (! is_readable($privateKey))
- please remove uneeded space
Thank
|
||
class MethodRSASHA1 extends AbstractSignatureMethod | ||
{ | ||
private $privateKey; |
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.
Docblock that it's string?
throw new \InvalidArgumentException('The private key is not readable'); | ||
} | ||
|
||
if (! function_exists('openssl_pkey_get_private')) { |
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 (! function_exists('openssl_pkey_get_private')) {
- please remove unneeded space
Thank
@@ -0,0 +1,75 @@ | |||
<?php | |||
/** | |||
* Copyright (c) Andreas Heigl<andreas@heigl.org> |
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.
It's not a SocialConnect LICENSE header
@@ -0,0 +1,83 @@ | |||
<?php | |||
/** | |||
* Copyright (c) Andreas Heigl<andreas@heigl.org> |
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.
Again, not SociallConnect LICENSE header
@heiglandreas I added small comments, if you can fix this will be cool |
This commit adds a new provider for self-hosted attlasian-instances. It has been tested against a self-hosted confluence version 5.9.8. Due to missing API-versioning there might be adaptions needed for general usage. Currently I only have this instance available for testing Ther ecurrently also are *no* tests!
8f925bd
to
46d77af
Compare
These mainly include removing whitespace and adding dockblocks
46d77af
to
f50b9a7
Compare
All your comments should be addressed by now. Thanks for the feedback! |
src/OAuth1/Provider/Atlassian.php
Outdated
* | ||
* Required configuration parameters are: | ||
* | ||
* * base_uri The base URI of your self-hosted atlassian product |
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.
In code the key is baseUri
not base_uri
.
src/OAuth1/Provider/Atlassian.php
Outdated
* Required configuration parameters are: | ||
* | ||
* * base_uri The base URI of your self-hosted atlassian product | ||
* * private_key The path to the private key file used for signing. |
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 correct? A quick search doesn't show any use of $parameters['private_key']
in the code.
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.
Thanks for spotting!!! I'll check that!!
This commit fixes the docblock describing the config-parameters
BIG Thank @heiglandreas Awesome! Take it 🍺 |
This commit adds a new provider for self-hosted attlasian-instances. It has been tested against a self-hosted confluence version 5.9.8.
Due to missing API-versioning there might be adaptions needed for general usage. Currently I only have this instance available for testing
There currently also are no tests!
In raising this pull request, I confirm the following (please check boxes):
Small description of change:
Thanks 😺