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