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

PSGI for HTTP::Tiny #5

Merged
merged 2 commits into from
Jan 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contact the organization administrators and just ask!

## Project Ideas

* [Perl 5 DBI: DBD::MariaDB Prepared Statements, Async, Test Suite](perl5/DBD-MariaDB.md)
* [Perl 5 DBI: DBD::MariaDB Prepared Statements, Async, Test Suite](perl/DBD-MariaDB.md)
- [Pod6 rendering on GitHub/GitLab](https://github.com/perl-foundation-outreach/gsoc-2020-ideas/blob/master/raku/pod6-rendering-on-github-gitlab.md)
- [Documentation tooling 2.0](raku/docs.md).
- [Raku community modules](raku/community-modules.md).
Expand Down
50 changes: 50 additions & 0 deletions perl/HTTP-Tiny-PSGI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
PSGI protocol for HTTP::Tiny
============================

Description
-----------

Add PSGI support for HTTP::Tiny which would allow ease of testing for code using the module.

Expected outcomes
-----------------

The https://metacpan.org/pod/LWP::Protocol::PSGI module allows you to provide code that will called to respond to requests you make with LWP, rather than them going off to a server. LWP is multiprotocol, so lends itself to having PSGI added.

A GSoC student would author something analogous, but for HTTP::Tiny.

The pod of LWP::Protocol::PSGI has a good example, where a trivial dancer app is loaded to respond to LWP requests to google.com. In a test file, an author can mock a web service without having to start up a http daemon of some sort, and doesnt need to insert shims in their code either. Another example from the real world is https://metacpan.org/source/HAKOBE/WebService-SyoboiCalendar-0.02/t/lib/SyobocalMock.pm. The code being tested in entirely unaware of the subterfuge.

See also Furl::PSGI

A version for HTTP::Tiny would do something very similar. Authors of code using HTTP::Tiny could use this new HTTP::Tiny w/ PSGI in their test suites to mock web services they want to test against.


For HTTP::Tiny to speak to something via PSGI, the Student would study and decide upon:

- Faking HTTP::Tiny entirely, with a module that would be loaded prior to HTTP::Tiny and trick perl in to not loading it

- Add hooks in HTTP::Tiny, so that PSGI can be used

- Sub-class HTTP::Tiny and override necessary functions, similar to Furl::PSGI

- Other, as suggested by more creative perl people

Having made an informed decision, proceed to author the module and release it to the CPAN.

Required skills
---------------

Reasonable understanding of Perl and testing in Perl.

Rating
------

Medium.

Possible mentors
----------------

- Dean H ([email protected] / [CPAN](https://metacpan.org/author/DJZORT) / [GitHub](https://github.com/djort))
- Kieran D ([email protected] / [CPAN](https://metacpan.org/author/ZARQUON) / [GitHub](https://github.com/singingfish))
- Tom M ([email protected] / [CPAN](https://metacpan.org/author/TMETRO) / [GitHub](https://github.com/tmetro)