| 1 | |||
| 2 | package Net::OpenID::Extension; | ||
| 3 | $Net::OpenID::Extension::VERSION = '1.20'; | ||
| 4 | use strict; | ||
| 5 | |||
| 6 | =head1 NAME | ||
| 7 | |||
| 8 | Net::OpenID::Extension - Base class for OpenID extensions | ||
| 9 | |||
| 10 | =head1 VERSION | ||
| 11 | |||
| 12 | version 1.20 | ||
| 13 | |||
| 14 | =head1 METHODS | ||
| 15 | |||
| 16 | =head2 CLASS->namespace_uris | ||
| 17 | |||
| 18 | Return a hashref mapping namespace URIs to the aliases you will use | ||
| 19 | to refer to them in the other methods. For example: | ||
| 20 | |||
| 21 | return { | ||
| 22 | 'http://example.com/some-extension' => 'someext', | ||
| 23 | }; | ||
| 24 | |||
| 25 | =head2 CLASS->new_request(@parameters) | ||
| 26 | |||
| 27 | When your extension is added to the L<Net::OpenID::ClaimedIdentity> | ||
| 28 | object in consumer-land, this method will be called to create | ||
| 29 | a request object. Any additional arguments passed when adding the | ||
| 30 | extension will be passed through verbatim in C<@parameters>. | ||
| 31 | |||
| 32 | The object you return here should at minimum provide the interface | ||
| 33 | defined in L<Net::OpenID::ExtensionMessage>. | ||
| 34 | |||
| 35 | You can return C<undef> here if you have nothing useful to return. | ||
| 36 | |||
| 37 | =head2 CLASS->received_request(\%args) | ||
| 38 | |||
| 39 | In server-land, when a caller asks for the request object for your | ||
| 40 | extension this method will be called to create a request object. | ||
| 41 | C<%args> maps the aliases you returned from the C<namespace_uris> | ||
| 42 | method to a hashref of the key-value pairs provided in that namespace. | ||
| 43 | |||
| 44 | The object you return here should at minimum provide the interface | ||
| 45 | defined in L<Net::OpenID::ExtensionMessage>, and should behave | ||
| 46 | identically to the corresponding object returned from C<new_request>. | ||
| 47 | |||
| 48 | You can return C<undef> here if you have nothing useful to return. | ||
| 49 | |||
| 50 | =head2 CLASS->new_response(@parameters) | ||
| 51 | |||
| 52 | When your extension is added to the response in server-land, this | ||
| 53 | method will be called to create a response object. Any additional | ||
| 54 | arguments passed when adding the extension will be passed through | ||
| 55 | verbatim in C<@parameters>. | ||
| 56 | |||
| 57 | You can return C<undef> here if you have nothing useful to return. | ||
| 58 | |||
| 59 | =head2 CLASS->received_response(\%args) | ||
| 60 | |||
| 61 | In consumer-land, when a caller asks for the request object for | ||
| 62 | your extension in L<Net::OpenID::VerifiedIdentity> this method | ||
| 63 | will be called to create a response object. | ||
| 64 | C<%args> maps the aliases you returned from the C<namespace_uris> | ||
| 65 | method to a hashref of the key-value pairs provided in that namespace. | ||
| 66 | |||
| 67 | You can return C<undef> here if you have nothing useful to return. | ||
| 68 | |||
| 69 | =cut | ||
| 70 | |||
| 71 | sub namespace_uris { | ||
| 72 | return {}; | ||
| 73 | } | ||
| 74 | |||
| 75 | sub new_request { | ||
| 76 | return undef; | ||
| 77 | } | ||
| 78 | |||
| 79 | sub new_response { | ||
| 80 | return undef; | ||
| 81 | } | ||
| 82 | |||
| 83 | sub received_request { | ||
| 84 | return undef; | ||
| 85 | } | ||
| 86 | |||
| 87 | sub received_response { | ||
| 88 | return undef; | ||
| 89 | } | ||
| 90 | |||
| 91 | 1; |