Skip to content
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

Inject encoder #23

Merged
merged 3 commits into from
Feb 26, 2015
Merged

Inject encoder #23

merged 3 commits into from
Feb 26, 2015

Conversation

greg0ire
Copy link
Contributor

Comes with tests and docs. I had to update phpunit to be able to use prophecy, which comes with phpunit 4.5

$header = json_decode($encoder->decode($parts[0]), true);
$payload = json_decode($encoder->decode($parts[1]), true);
$header = json_decode($pwet = $encoder->decode($parts[0]), true);
$payload = json_decode($meuh = $encoder->decode($parts[1]), true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are these variables? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What variables ? There are no variables… there never were variables. Seriously, good catch, I used that for debugging while writing my tests, sorry for this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no worries :)

On Wed, Feb 11, 2015 at 12:46 PM, Grégoire Paris notifications@github.com
wrote:

In src/Namshi/JOSE/JWS.php
#23 (comment):

     $parts   = explode('.', $jwsTokenString);

     if (count($parts) === 3) {
  •        $header  = json_decode($encoder->decode($parts[0]), true);
    
  •        $payload = json_decode($encoder->decode($parts[1]), true);
    
  •        $header  = json_decode($pwet = $encoder->decode($parts[0]), true);
    
  •        $payload = json_decode($meuh = $encoder->decode($parts[1]), true);
    

What variables ? There are no variables… there never were variables.
Seriously, good catch, I used that for debugging while writing my tests,
sorry for this


Reply to this email directly or view it on GitHub
https://github.com/namshi/jose/pull/23/files#r24480019.

Nadalin Alessandro
http://www.linkedin.com/in/alessandronadalin
www.odino.org
www.twitter.com/_odino_

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ops these are still here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

push -f from work then from home (or the other way around explains it). Sorry for that, I'll fix it rightaway!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont worry :)

On Tue, Feb 17, 2015 at 3:32 PM, Grégoire Paris notifications@github.com
wrote:

In src/Namshi/JOSE/JWS.php
#23 (comment):

     $parts   = explode('.', $jwsTokenString);

     if (count($parts) === 3) {
  •        $header  = json_decode($encoder->decode($parts[0]), true);
    
  •        $payload = json_decode($encoder->decode($parts[1]), true);
    
  •        $header  = json_decode($pwet = $encoder->decode($parts[0]), true);
    
  •        $payload = json_decode($meuh = $encoder->decode($parts[1]), true);
    

push -f from work then from home (or the other way around explains it).
Sorry for that, I'll fix it rightaway!


Reply to this email directly or view it on GitHub
https://github.com/namshi/jose/pull/23/files#r24810271.

Nadalin Alessandro
http://www.linkedin.com/in/alessandronadalin
www.odino.org
www.twitter.com/_odino_

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@greg0ire
Copy link
Contributor Author

Sound good ?

->willReturn('{"alg": "test"}')
->shouldBeCalled();
JWS::load($this->jws->getTokenString(), $encoder->reveal());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnt the encoder mocked twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the same method is mocked for two consecutive calls (decoding the header then decoding the payload). Apparently, this need to be done in reverse order (must be a heap).

@greg0ire greg0ire force-pushed the inject_encoder branch 3 times, most recently from 9e76286 to 4c98494 Compare February 17, 2015 11:34
@odino
Copy link
Contributor

odino commented Feb 25, 2015

hey man :) could you please rebase?

Grégoire Paris added 2 commits February 25, 2015 10:18
Vulnerabilities are not something you are vulnerable to, they are
something you have.
@greg0ire
Copy link
Contributor Author

hey! I'm done. I added some commits because I noticed some mistakes in the README will fixing some conflicts.

to a security vulnerability. More info [here](http://tech.namshi.com/blog/2015/02/19/update-your-namshi-slash-jose-installations-as-a-security-vulnerability-was-found/).**
use previous versions other than 1.0.2, 1.1.2, 2.0.3 as they have a security
vulnerability. More info [here](http://tech.namshi.com/blog/2015/02/19/update-your-namshi-slash-jose-installations-as-a-security-vulnerability-was-found/).**

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks man!

odino added a commit that referenced this pull request Feb 26, 2015
@odino odino merged commit db81fbd into namshi:master Feb 26, 2015
@odino
Copy link
Contributor

odino commented Feb 26, 2015

👍

@greg0ire greg0ire deleted the inject_encoder branch May 19, 2015 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants