The Inputstream module is only useful when multiple modules are all trying to use the same stream at the same time. It's not very likely to happen to most users so I think the Inputstream module should be optional for the REST Server. Implementing a fallback for the cases where it isn't installed is easy - take a look at how I solved it in the OAuth module: https://github.com/voxpelli/drupal-oauth/commit/6ccb0d87fbf704ebfb6e7544...

(The suggest property in the info file is used by Module supports and there is a discussion at #328932: Modules and partial dependencies - enhances[] and enhancedby[] field in modules' .info.yml files about supporting it at Drupal.org and perhaps in future versions of Drupal core)

CommentFileSizeAuthor
#8 services-1017036.patch853 byteskylebrowning
#4 1017036.patch1.42 KBgdd
#3 1017036.patch1.43 KBgdd

Comments

gdd’s picture

Version: 6.x-3.0-beta2 » 7.x-3.x-dev

Making this a 7.x issue since it affects both.

Wouldn't this then break situations where for instance, you are using both oAuth and REST (since each would want to read the stream and only one could.) I would love to remove the dependency, but I don't want to make things more difficult for people either.

Another option would be to just move the InputStream code into Services but that seems silly kind of.

I like the suggests property but I mean, if it can actively break your site then its not really a 'suggestion' in my book.

voxpelli’s picture

Looking at it now my workaround in the OAuth module for the lack of the Inputstream module was wrong - I opened a new issue for that: #1017220: Deactivate body_hash-checking when Inpustream isn't installed

The OAuth module only uses the Inputstream module to check the validity of an optional body hash, which isn't part of the core OAuth specification. When #1017220: Deactivate body_hash-checking when Inpustream isn't installed is solved the only downside of not having Inputstream installed when using Services and OAuth together is that any client supporting body hashes won't have them validated. If we only document that fact well in the OAuth module it won't be an issue. (Since the OAuth module is currently lacking documentation completely nobody knows they can include the body_hash now anyway :P)

gdd’s picture

Status: Active » Needs review
StatusFileSize
new1.43 KB

I'm convinced, can someone sanity check this patch?

gdd’s picture

StatusFileSize
new1.42 KB

No this one.

voxpelli’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me - maybe you should add some documentation of Services support for Inputstream in the readme or so?

gdd’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Status: Reviewed & tested by the community » Active

This has been committed to 7, needs to be rerolled for 6

voxpelli’s picture

Status: Active » Patch (to be ported)

We've got a cool status for that ;)

kylebrowning’s picture

Status: Patch (to be ported) » Fixed
StatusFileSize
new853 bytes

Committed, attached patch

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.