Skip to content

Conversation

peter279k
Copy link
Contributor

@peter279k peter279k commented Dec 10, 2020

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets issue #43
Documentation N/A
License MIT

Closes #43.

What's in this PR?

  • Using the hash('sha512') to replace sha1 function.

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
  • Documentation pull request created (if not simply a bugfix)

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

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

thanks a lot for picking this one up!

i added some suggestions. @sagikazarmark do we need to worry about a BC break when the default changes from sha1 to sha512?

@peter279k peter279k force-pushed the issue_#43 branch 3 times, most recently from d4ae46d to b641a6a Compare December 19, 2020 16:07
Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

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

finally got around to look at this. can we make the hashing completely configurable, while we are at it?

@@ -10,7 +10,7 @@
final class CookieJar implements \Countable, \IteratorAggregate
{
/**
* @var \SplObjectStorage
* @var \SplObjectStorage<object, mixed>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix static analysis issue via PHPStan:

 ------ -------------------------------------------------------------- 
  Line   CookieJar.php                                                 
 ------ -------------------------------------------------------------- 
  15     Property Http\Message\CookieJar::$cookies with generic class  
         SplObjectStorage does not specify its types: TObject, TData   
         💡 You can turn this off by setting                            
         checkGenericClassInNonGenericObjectType: false in your        
         phpstan.neon.dist.                                            
 ------ -------------------------------------------------------------- 

use StreamDecorator {
rewind as private doRewind;
seek as private doSeek;
}
const BUFFER_SIZE = 8192;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix coding style issue:

 2) src/Encoding/FilteredStream.php
      ---------- begin diff ----------
--- Original
+++ New
@@ -13,12 +13,11 @@
  */
 abstract class FilteredStream implements StreamInterface
 {
-    const BUFFER_SIZE = 8192;
-
     use StreamDecorator {
         rewind as private doRewind;
         seek as private doSeek;
     }
+    const BUFFER_SIZE = 8192;
 
     /**
      * @var callable

      ----------- end diff -----------

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

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

thanks a lot for the contribution, and thanks for your patience while we sorted this out. this looks ready to merge to me.

@php-http/core any further input or fine if merge and tag version 1.11.0 with this?

@dbu dbu merged commit 659f876 into php-http:master Feb 1, 2021
@dbu
Copy link
Contributor

dbu commented Feb 1, 2021

thanks a lot! i added documentation about this in php-http/documentation@aaeef9c and released this as https://github.com/php-http/message/releases/tag/1.11.0

if you have time to add a configuration option to the symfony bundle as well, that would be neat: https://github.com/php-http/HttplugBundle

@peter279k peter279k deleted the issue_#43 branch February 1, 2021 10:16
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.

WSSE Authentication allow to change hashing algorithm
2 participants