| 1 | package cPanel::APIClient::Authn::Token; | ||
| 2 | |||
| 3 | # Copyright 2020 cPanel, L. L. C. | ||
| 4 | # All rights reserved. | ||
| 5 | # http://cpanel.net | ||
| 6 | # | ||
| 7 | # This is free software; you can redistribute it and/or modify it under the | ||
| 8 | # same terms as Perl itself. See L<perlartistic>. | ||
| 9 | |||
| 10 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 2 | ▶ | use parent 'cPanel::APIClient::Authn'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 6 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 16 | 6 | my ( $class, $username, $token ) = @_; | |
| 17 | |||
| 18 | 6 | return bless [ $username, $token ], $class; | |
| 19 | } | ||
| 20 | |||
| 21 | 6 | ▶ | sub get_http_headers_for_service { |
|
Subroutine
get_http_headers_for_service: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 22 | 6 | my ( $self, $service_obj ) = @_; | |
| 23 | |||
| 24 | 6 | my $hdr_svc = $service_obj->service_name(); # TODO: check for whostmgr | |
| 25 | |||
| 26 | 6 | return [ Authorization => "$hdr_svc $self->[0]:$self->[1]" ]; | |
| 27 | } | ||
| 28 | |||
| 29 | 2 | 1; | |