[pve-devel] applied: [PATCH v3 pmg-api 1/1] ensure compatibility with libpve-http-server-perl

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jan 29 21:46:55 CET 2020


On 1/21/20 1:54 PM, Fabian Grünbichler wrote:
> Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> ---
> 
> Notes:
>     new in v3
>     
>     requires depends on libpve-http-server which changed these interfaces
> 
>  src/PMG/HTTPServer.pm       | 4 +++-
>  src/PMG/Service/pmgproxy.pm | 2 +-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/PMG/HTTPServer.pm b/src/PMG/HTTPServer.pm
> index 8c29059..eb48b5f 100755
> --- a/src/PMG/HTTPServer.pm
> +++ b/src/PMG/HTTPServer.pm
> @@ -42,7 +42,7 @@ sub generate_csrf_prevention_token {
>  }
>  
>  sub auth_handler {
> -    my ($self, $method, $rel_uri, $ticket, $token, $peer_host) = @_;
> +    my ($self, $method, $rel_uri, $ticket, $token, $api_token, $peer_host) = @_;
>  
>      my $rpcenv = $self->{rpcenv};
>  
> @@ -66,6 +66,8 @@ sub auth_handler {
>  
>      if ($require_auth) {
>  
> +	die "API tokens not implemented\n" if $api_token;
> +
>  	die "No ticket\n" if !$ticket;
>  
>  	if ($ticket =~ m/^PMGQUAR:/) {
> diff --git a/src/PMG/Service/pmgproxy.pm b/src/PMG/Service/pmgproxy.pm
> index e88d757..ea58b50 100755
> --- a/src/PMG/Service/pmgproxy.pm
> +++ b/src/PMG/Service/pmgproxy.pm
> @@ -192,7 +192,7 @@ sub get_index {
>  		$lang = $newlang;
>  	    }
>  	}
> -	my $ticket = PVE::APIServer::Formatter::extract_auth_cookie($cookie, $server->{cookie_name});
> +	my $ticket = PVE::APIServer::Formatter::extract_auth_value($cookie, $server->{cookie_name});
>  
>  	if ($ticket =~ m/^PMGQUAR:/) {
>  	    $username = PMG::Ticket::verify_quarantine_ticket($ticket, 1);
> 

applied, thanks!





More information about the pve-devel mailing list