]> git.proxmox.com Git - pve-apiclient.git/log
pve-apiclient.git
4 weeks agobump version to 3.3.2 master
Thomas Lamprecht [Tue, 26 Mar 2024 08:35:58 +0000 (09:35 +0100)]
bump version to 3.3.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agofix validation of self-signed cert chains
Fabian Grünbichler [Tue, 26 Mar 2024 08:15:02 +0000 (09:15 +0100)]
fix validation of self-signed cert chains

The interface here is a bit weird - if the verify callback returns 1
for a certificate higher up in the chain, this will propagate to the
next invocation of the callback for the next certificate, even if
openssl on its own would not trust the certificate.

By re-ordering the checks and keeping track of the fact that we
returned 1 despite openssl failing its own validation, the validation
logic should now cover all combinations of certificate count and
self-signed/system trust status.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
10 months agobump version to 3.3.1
Thomas Lamprecht [Fri, 9 Jun 2023 05:54:46 +0000 (07:54 +0200)]
bump version to 3.3.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agolwp: set SameSite attr of auth cookie to 'strict'
Max Carrara [Wed, 15 Mar 2023 16:26:30 +0000 (17:26 +0100)]
lwp: set SameSite attr of auth cookie to 'strict'

This prohibits the cookie from being sent along in cross-site
sub-requests or when the user navigates to a different site.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
11 months agobuildsys: derive upload dist automatically
Thomas Lamprecht [Fri, 19 May 2023 14:23:18 +0000 (16:23 +0200)]
buildsys: derive upload dist automatically

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobump version to 3.3.0
Thomas Lamprecht [Fri, 19 May 2023 14:22:44 +0000 (16:22 +0200)]
bump version to 3.3.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobuildsys: add sbuild convenience target
Thomas Lamprecht [Fri, 19 May 2023 14:22:36 +0000 (16:22 +0200)]
buildsys: add sbuild convenience target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobuildsys: cleanup deb/dsc targets
Thomas Lamprecht [Fri, 19 May 2023 14:22:19 +0000 (16:22 +0200)]
buildsys: cleanup deb/dsc targets

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoseparate packaging and source build system
Thomas Lamprecht [Fri, 19 May 2023 14:21:48 +0000 (16:21 +0200)]
separate packaging and source build system

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobuildsys: encode prerequisites of install target
Thomas Lamprecht [Fri, 19 May 2023 13:52:46 +0000 (15:52 +0200)]
buildsys: encode prerequisites of install target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobuildsys: cleanup and expand clean target
Thomas Lamprecht [Fri, 19 May 2023 13:52:17 +0000 (15:52 +0200)]
buildsys: cleanup and expand clean target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agouse dpkg's packaging variable makefile fragment
Thomas Lamprecht [Fri, 19 May 2023 13:51:39 +0000 (15:51 +0200)]
use dpkg's packaging variable makefile fragment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agod/control: define compat level via build-depends and raise to 13
Thomas Lamprecht [Fri, 19 May 2023 13:42:18 +0000 (15:42 +0200)]
d/control: define compat level via build-depends and raise to 13

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoexception: white space cleanup
Thomas Lamprecht [Fri, 19 May 2023 13:41:37 +0000 (15:41 +0200)]
exception: white space cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoremove Exception update targets, just comment how
Thomas Lamprecht [Fri, 19 May 2023 13:36:44 +0000 (15:36 +0200)]
remove Exception update targets, just comment how

it's very odd to have buildsystem targets that go over the git repos
root directory boundary, as one *must not* depend on unrelated
things.

Rather just comment that and how this was derived from pve-common's
exception module.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agomakefile: convert to use simple parenthesis
Thomas Lamprecht [Thu, 18 May 2023 14:01:14 +0000 (16:01 +0200)]
makefile: convert to use simple parenthesis

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agotfa: clarify error on unsupported types a bit
Thomas Lamprecht [Thu, 2 Dec 2021 18:23:15 +0000 (19:23 +0100)]
tfa: clarify error on unsupported types a bit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agosupport new tfa api
Wolfgang Bumiller [Tue, 30 Nov 2021 09:57:40 +0000 (10:57 +0100)]
support new tfa api

Note that in PVE we should instantiate the API client with
`pve_new_format` in order to have this client also switch to
the new mechanism, otherwise the old api will be used which
does not support multiple factors or recovery keys.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 3.2-1
Thomas Lamprecht [Mon, 28 Jun 2021 14:45:28 +0000 (16:45 +0200)]
bump version to 3.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobuildsys: change upload dist to bullseye
Thomas Lamprecht [Mon, 28 Jun 2021 14:44:53 +0000 (16:44 +0200)]
buildsys: change upload dist to bullseye

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: update dh-compat to 12 and bump standards version
Thomas Lamprecht [Mon, 28 Jun 2021 14:44:32 +0000 (16:44 +0200)]
d/control: update dh-compat to 12 and bump standards version

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agod/compate: update to 10
Thomas Lamprecht [Mon, 14 Dec 2020 19:44:03 +0000 (20:44 +0100)]
d/compate: update to 10

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 3.1-3
Thomas Lamprecht [Fri, 4 Dec 2020 11:25:32 +0000 (12:25 +0100)]
bump version to 3.1-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoimprove protocol selection heuristic
Thomas Lamprecht [Fri, 4 Dec 2020 11:18:45 +0000 (12:18 +0100)]
improve protocol selection heuristic

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 3.1-2
Thomas Lamprecht [Thu, 3 Dec 2020 15:09:08 +0000 (16:09 +0100)]
bump version to 3.1-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodefault to verifying cert hostname if no fingerprint is passed
Thomas Lamprecht [Thu, 3 Dec 2020 15:07:50 +0000 (16:07 +0100)]
default to verifying cert hostname if no fingerprint is passed

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agocert verification: trust openssl result if hostnames are verified
Thomas Lamprecht [Thu, 3 Dec 2020 15:00:00 +0000 (16:00 +0100)]
cert verification: trust openssl result if hostnames are verified

If we verified that the hostname matches the cert we can also trust
the openssl verification result.

We get the openssl result as first parameter[0].

[0]: https://metacpan.org/pod/IO::Socket::SSL#SSL_verify_callback

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoformat/code cleanup
Thomas Lamprecht [Thu, 3 Dec 2020 14:59:06 +0000 (15:59 +0100)]
format/code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoclient exception: try to avoid HTTP code duplication in error string
Thomas Lamprecht [Thu, 3 Dec 2020 14:55:53 +0000 (15:55 +0100)]
client exception: try to avoid HTTP code duplication in error string

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agoexamples: add CLI like example for easier re-use with non-local host
Thomas Lamprecht [Thu, 3 Dec 2020 14:55:11 +0000 (15:55 +0100)]
examples: add CLI like example for easier re-use with non-local host

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 3.1-1
Thomas Lamprecht [Mon, 30 Nov 2020 14:30:23 +0000 (15:30 +0100)]
bump version to 3.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agouse two-argument bless
Thomas Lamprecht [Mon, 30 Nov 2020 14:03:30 +0000 (15:03 +0100)]
use two-argument bless

else we'd break "inheriting" (or whatever perl does is called) to
child modules

> Never use the one-argument form of bless.
-- Perl Best Practices, Pg. 365

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodo not save user-agent ssl_opts in $self
Thomas Lamprecht [Mon, 30 Nov 2020 14:02:29 +0000 (15:02 +0100)]
do not save user-agent ssl_opts in $self

one can always get it from the useragent, changing it here would not
do anything anyway, so this also avoids some possible confusion.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agorework FP verify callback to avoid creating refcount cycle
Thomas Lamprecht [Mon, 30 Nov 2020 14:00:38 +0000 (15:00 +0100)]
rework FP verify callback to avoid creating refcount cycle

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agosort use statements, drop Data::Dumper
Thomas Lamprecht [Mon, 30 Nov 2020 14:01:49 +0000 (15:01 +0100)]
sort use statements, drop Data::Dumper

print to_json($ref, {pretty=>1,utf8=>1,canonical=>1})."\n";

is nicer anyway ;-)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 3.0-3
Thomas Lamprecht [Fri, 7 Feb 2020 06:54:35 +0000 (07:54 +0100)]
bump version to 3.0-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoimplement api token support
Fabian Grünbichler [Thu, 30 Jan 2020 11:07:52 +0000 (12:07 +0100)]
implement api token support

and add an example for it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agofix #2227: enable totp codes to be passed in cli
Oguz Bektas [Fri, 16 Aug 2019 11:51:34 +0000 (13:51 +0200)]
fix #2227: enable totp codes to be passed in cli

this patch enables to pass totp codes during cluster join if tfa has
been enabled for root@pam (or any other user actually, but having it enabled on
root causes problems during cluster join).

u2f support is not yet implemented.

Co-developed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Co-developed-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agobump version to 3.0-2
Thomas Lamprecht [Thu, 11 Jul 2019 17:29:54 +0000 (19:29 +0200)]
bump version to 3.0-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agologin TFA exception: also print username and use raise
Thomas Lamprecht [Thu, 27 Jun 2019 20:04:33 +0000 (22:04 +0200)]
login TFA exception: also print username and use raise

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocheck for tfa during cluster join, abort if yes
Oguz Bektas [Thu, 27 Jun 2019 16:00:48 +0000 (18:00 +0200)]
check for tfa during cluster join, abort if yes

momentarily, we check for tfa in the cluster join and abort if it's
enabled, since the tfa ticket is not being handled correctly atm, which
caused a '401 No ticket' error[0][1].

todo is to ask with a prompt on gui and cli to enable totp and possible
u2f in the future

[0]: https://forum.proxmox.com/threads/failed-to-add-cluster-node-401-no-ticket.54882/
[1]: https://bugzilla.proxmox.com/show_bug.cgi?id=2227

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agobuildsys: change upload dist to buster
Thomas Lamprecht [Tue, 21 May 2019 16:34:43 +0000 (18:34 +0200)]
buildsys: change upload dist to buster

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: update standards version
Thomas Lamprecht [Tue, 21 May 2019 16:33:12 +0000 (18:33 +0200)]
d/control: update standards version

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 3.0-1
Thomas Lamprecht [Tue, 21 May 2019 15:28:30 +0000 (17:28 +0200)]
bump version to 3.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: add defined ${perl:Depends} to dependency list
Thomas Lamprecht [Tue, 21 May 2019 14:47:49 +0000 (16:47 +0200)]
d/control: add defined ${perl:Depends} to dependency list

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoset debian source format to 1.0
Thomas Lamprecht [Tue, 21 May 2019 14:46:45 +0000 (16:46 +0200)]
set debian source format to 1.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agodebian/rules should be executable
Thomas Lamprecht [Tue, 21 May 2019 14:46:27 +0000 (16:46 +0200)]
debian/rules should be executable

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoMerge missing changelog entry
Dietmar Maurer [Wed, 24 Apr 2019 09:14:19 +0000 (11:14 +0200)]
Merge missing changelog entry

5 years agoGet version information from changelog
Rhonda D'Vine [Fri, 28 Dec 2018 17:24:07 +0000 (18:24 +0100)]
Get version information from changelog

The duplication of the version information both in the Makefile and in
debian/changelog is a potential error point, and an unneeded one.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
5 years agoAdd SOURCE file
Rhonda D'Vine [Fri, 28 Dec 2018 17:24:06 +0000 (18:24 +0100)]
Add SOURCE file

This package was missing the SOURCE information from the binary package.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
5 years agoAdd "make dsc" target
Rhonda D'Vine [Fri, 28 Dec 2018 17:24:05 +0000 (18:24 +0100)]
Add "make dsc" target

This target is required to make the package build automatically.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
5 years agobump version to 2.0-5
Dietmar Maurer [Tue, 19 Jun 2018 11:05:58 +0000 (13:05 +0200)]
bump version to 2.0-5

5 years agoadd make target to copy and include files from pve-common - update Exception.pm
Dietmar Maurer [Thu, 14 Jun 2018 07:59:17 +0000 (09:59 +0200)]
add make target to copy and include files from pve-common - update Exception.pm

6 years agobump version to 2.0-4
Wolfgang Bumiller [Mon, 22 Jan 2018 14:15:09 +0000 (15:15 +0100)]
bump version to 2.0-4

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 years agoavoid harmful '<>' pattern, explicitly read from STDIN
Thomas Lamprecht [Mon, 22 Jan 2018 09:52:13 +0000 (10:52 +0100)]
avoid harmful '<>' pattern, explicitly read from STDIN

Fixes problems in CLIHandler using the code pattern:

while (my $line = <>) {
    ...
}

For why this causes only _now_ problems lets first look how <>
behaves:

"The null filehandle <> is special: [...] Input from <> comes either
from standard input, or from each file listed on the command line.
Here's how it works: the first time <> is evaluated, the @ARGV array
is checked, and if it is empty, $ARGV[0] is set to "-" , which when
opened gives you standard input.  The @ARGV array is then processed
as a list of filenames." - 'perldoc perlop'

Recent changes in the CLIHandler code changed how we modfiied @ARGV
Earlier we assumed that the first argument must be the command and
thus shifted it out of @ARGV, now we can have multiple levels of
(sub)commands. This change also changed how we handle @ARGV, we do
not unshift anything but go through the arguments until we got to
the final command and copy the rest of @ARGV as we know that this
must be the commandos arguments.

For '<>' this means that ARGV was still fully populated and perl
tried to open element as a file, which naturally failed.
Thus the change in pve-common only exposed this 'dangerous' code
pattern.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agobump version to 2.0-3
Fabian Grünbichler [Wed, 17 Jan 2018 13:17:10 +0000 (14:17 +0100)]
bump version to 2.0-3

6 years agoraise exception if manual fingerprint verification failed
Thomas Lamprecht [Thu, 14 Dec 2017 10:12:06 +0000 (11:12 +0100)]
raise exception if manual fingerprint verification failed

If a fingerprint could not be verified automatically or manually
raise an exception to ensure that we do not continue with handling
the problematic or even evil response.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agouse new Exception.pm class to signal errors to caller
Thomas Lamprecht [Thu, 14 Dec 2017 10:12:05 +0000 (11:12 +0100)]
use new Exception.pm class to signal errors to caller

Allows a caller to acces the HTTP response code, which may be useful
to handle application logic. E.g., catching a HTTP_NOT_IMPLEMENTED
and fallback to an older method.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoadd APIClient/Exception.pm class
Thomas Lamprecht [Thu, 14 Dec 2017 10:12:04 +0000 (11:12 +0100)]
add APIClient/Exception.pm class

As we do not want to depend on PVE libraries with this I forked of
the PVE::Exception class, removed all raise_* methods so that only
raise() itself was left over.

Also some minor adaptions to newer style for exporting where used.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agobuildsys: also cleanup *.buildinfo files
Thomas Lamprecht [Thu, 14 Dec 2017 10:38:17 +0000 (11:38 +0100)]
buildsys: also cleanup *.buildinfo files

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 years agoadd missing if
Fabian Grünbichler [Tue, 12 Dec 2017 10:02:48 +0000 (11:02 +0100)]
add missing if

6 years agocleanup Net::SSLeay error handling
Fabian Grünbichler [Mon, 27 Nov 2017 09:18:48 +0000 (10:18 +0100)]
cleanup Net::SSLeay error handling

X509_get_fingerprint does not die - it only returns undef in case of
errors (or segfaults if the $cert pointer is invalid).

6 years agobuild: reformat debian/control
Fabian Grünbichler [Wed, 4 Oct 2017 09:05:33 +0000 (11:05 +0200)]
build: reformat debian/control

using wrap-and-sort -abt

7 years agobump version to 2.0-2
Dietmar Maurer [Thu, 6 Apr 2017 09:04:48 +0000 (11:04 +0200)]
bump version to 2.0-2

7 years agoallow to specify cookie_name
Dietmar Maurer [Thu, 6 Apr 2017 09:03:41 +0000 (11:03 +0200)]
allow to specify cookie_name

7 years agobump version tp 2.0-1 for debain stretch
Dietmar Maurer [Fri, 10 Mar 2017 08:07:50 +0000 (09:07 +0100)]
bump version tp 2.0-1 for debain stretch

Makefile: use "--product pmg,pve --dist stretch" for upload target

7 years agoperftest1.pl: another example
Dietmar Maurer [Wed, 28 Dec 2016 10:35:30 +0000 (11:35 +0100)]
perftest1.pl: another example

7 years agoexample2.pl: add a second example
Dietmar Maurer [Wed, 28 Dec 2016 10:04:37 +0000 (11:04 +0100)]
example2.pl: add a second example

7 years agoexample1.pl: remove unnecessary perfix /api2/json/
Dietmar Maurer [Wed, 28 Dec 2016 09:52:09 +0000 (10:52 +0100)]
example1.pl: remove unnecessary perfix /api2/json/

7 years agoexample1.pl: use warnings instead of -w flag
Dietmar Maurer [Wed, 28 Dec 2016 09:49:20 +0000 (10:49 +0100)]
example1.pl: use warnings instead of -w flag

7 years agoadd simple example code, bump version to 1.0-2
Dietmar Maurer [Wed, 28 Dec 2016 09:47:23 +0000 (10:47 +0100)]
add simple example code, bump version to 1.0-2

7 years agoadd missing dependencies
Dietmar Maurer [Fri, 16 Dec 2016 08:34:14 +0000 (09:34 +0100)]
add missing dependencies

7 years agoadd dintsall target
Dietmar Maurer [Fri, 16 Dec 2016 08:23:14 +0000 (09:23 +0100)]
add dintsall target

7 years agoadd Makefile and debian package files
Dietmar Maurer [Fri, 16 Dec 2016 08:21:41 +0000 (09:21 +0100)]
add Makefile and debian package files

7 years agoinitial import
Dietmar Maurer [Fri, 16 Dec 2016 07:52:37 +0000 (08:52 +0100)]
initial import

copied from pve-gui-tests