Skip to content

Conversation

@deleugpn
Copy link
Contributor

While implementing AWS KMS encryption, I had to define my own Interface extending from Laravel's Encrypter in order to get better method access.

@driesvints
Copy link
Member

I don't feel like we should update this contract specifically for that use case. Can't you roll your own encrypter for that use case?

@deleugpn
Copy link
Contributor Author

I did roll my own. However, Eloquent uses the Crypto Facade which already depend on these methods and when I swap Laravel implementation with my own, the contract is incomplete. Anybody implementing this interface to roll their own implementation of Laravel Encrypter is likely implementing these two methods or their Facade is broken.

@driesvints
Copy link
Member

@deleugpn thanks for making me aware. I've sent in an alternative PR to this one here: #36573

@taylorotwell
Copy link
Member

You can work around the breaking change by creating a totally separate interface called StringEncrypter and have the Laravel encrypter implement both interfaces by default.

@driesvints
Copy link
Member

@taylorotwell the current methods are just proxies. I don't think we should be adding a new interface for just those.

@deleugpn
Copy link
Contributor Author

@taylorotwell I thought about that as well, but decided to wait on a feedback before trying it.
Will send a PR shortly.

@deleugpn
Copy link
Contributor Author

@driesvints the fact that they're proxies is an implementation detail. The interface is suppose to expose intent and all we're looking for here is a better interface when the intention is to encrypt strings that never require serialization.

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.

3 participants