Wolfgang Bumiller
5720ba2dce
use new auth api crate
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-02 17:01:35 +01:00
Thomas Lamprecht
5df815f660
proxmox-tfa: update generated d/control
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-02 16:54:59 +01:00
Wolfgang Bumiller
32e7d3ccdf
bump proxmox-auth-api to 0.1.0-1
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:44:35 +01:00
Wolfgang Bumiller
1bccff7e68
auth-api: make example require pam-authenticator
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:44:35 +01:00
Wolfgang Bumiller
82e212e33a
bump schema dependency to 1.3.7 for auth-api
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:44:35 +01:00
Wolfgang Bumiller
2f5b1f26cc
bump proxmox-schema to 1.3.7-1
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:44:35 +01:00
Wolfgang Bumiller
bca9c6dbaf
bump proxmox-tfa to 3.0.0-1
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:44:35 +01:00
Wolfgang Bumiller
5349ae208b
add proxmox-auth-api crate
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:44:35 +01:00
Wolfgang Bumiller
a8bd8fca15
schema: add basic api types feature
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
f813e8d866
sort workspace members
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
8a90efba68
bump proxmox-metrics to 0.2.2
...
to update proxmox-http dep to 0.8
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
71794901c7
bump proxmox-subscription to 0.3.1
...
to update proxmox-http dependency
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
89eaf83755
bump proxmox-rest-server to 0.3.0-1
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
d422852f51
bump proxmox-http to 0.8.0
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
dcd6e85ab2
rest-server: update example to new ApiConfig
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
1f373b9276
rest-server: add wasm content type
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
b4bb3feef3
rest-server: tls-acceptor: allow setting cipher suite and list
...
just pass the strings to openssl
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
6873926dea
rest-server: generic certificate path types
...
to not require a PathBuf on the caller side
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
2f2f5cfcd8
rest-server: more convenient alias-list for ApiConfig
...
To the existing `.alias(item)`, add a
`.aliases(into-item-iter)` similar to how `Extend` works.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
310310c650
rest-server: make all ApiConfig methods builder-style
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
e2ac53e3de
rest-server: add AcceptorBuilder
...
The connection submodule now allows building an "acceptor"
for hyper connections which can either take an explicit ssl
acceptor, or builds a default one with a self signed
certificate.
The rate-limited-stream feature enables a method to
lookup/update rate limiters for connections.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
666f920291
rest-server: impl PeerAddress for RateLimitedStream via feature
...
rest-server can now optionally provide a PeerAddress
implementation for RateLimitedStream by activating its
'rate-limited-stream' feature
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
d7ed04f8e5
http: add RateLimitedStream::inner, drop peer_addr
...
instead of implementing 'peer_addr' specifically for
RateLimitedStream<tokio::net::TcpStream>, just provide
.inner() and .inner_mut() so the user can reach the inner
stream directly.
This way we can drop the tokio/net feature as well
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
b2c26f74a6
http: lower hyper feature requirements for client feature
...
instead of 'full', we only need 'tcp+http1+http2'
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
10a3ab222b
http: move rate-limiting out of client feature
...
this can now be used separately
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
b62d76e80c
http: start 0.8.0 refactoring
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
726bf413f5
rest-handler: more convenient auth/index handler setters
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
4639542fce
rest-server: PeerAddress for Pin<Box<T>>
...
since this is how tokio-openssl's SslStream is used in
practice
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
515cc729d0
rest-server: drop ServerAdapter, move AuthError
...
Instead of a ServerAdapter for the index page and
authentication checking (which don't relate to each other),
provide a `.with_auth_handler` and `.with_index_handler`
builder for ApiConfig separately.
Both are optional. Without an index handler, it'll produce a
404. Without an auth handler, an `AuthError::NoData` is
returned.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
6904dcf4e6
rest-server: make adapter optional
...
when no user information or index needs to be defined
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:14:04 +01:00
Wolfgang Bumiller
4a5360aef4
rest-server: drop Router from ApiConfig
...
instead, allow attaching routers to path prefixes and also
add an optional non-formatting router
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:13:55 +01:00
Wolfgang Bumiller
258e2399a6
rest-server: make handlebars optional as 'templates' feature
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 16:07:50 +01:00
Wolfgang Bumiller
28ba2016e5
rest-server: cleanup unreadable code
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 15:44:35 +01:00
Wolfgang Bumiller
a1119a3e63
rest-server: use BAD_REQUEST for non-GET on file-paths
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 15:44:35 +01:00
Wolfgang Bumiller
93c027f5cc
rest-server: make handle_request a method of ApiConfig
...
This is what actually defines the API server after all.
The ApiService trait in between is a hyper impl detail.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 15:44:35 +01:00
Wolfgang Bumiller
5fe0777318
rest-server: drop allocation in Service impl
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 15:44:35 +01:00
Wolfgang Bumiller
e377909bee
rest-server: PeerAddr trait, drop proxmox-http dep
...
We pulled in proxmox-http with the client feature solely to
implement the `Service` trait on
`SslStream<RateLimitedStream<TcpStream>>`.
All those `Service` impls are the same: provide a peer
address and return an `ApiService`.
Let's put the `peer_addr()` call into a trait and build from
there.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 15:44:35 +01:00
Wolfgang Bumiller
01436ae30f
rest-server: make socketpair private
...
`proxmox_rest_server::socketpair` doesn't make sense as an
external API
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 15:44:35 +01:00
Wolfgang Bumiller
ccc70bc95f
rest-server: start 0.3 api refactoring
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 15:44:35 +01:00
Wolfgang Bumiller
1a14696a5c
ldap: test fixup
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-02 15:44:11 +01:00
Wolfgang Bumiller
7e12788c60
sys: drop sortable and identity macros
...
We should not use the sys crate to pull in the sortable
macro, just depend on its crate instead...
And the identity macro used to be required by the sortable
macro, but is not anymore and has been deprecated for a
while, so we can now drop it.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-03-01 13:40:40 +01:00
Wolfgang Bumiller
2cf54dcf2e
router: make format&print generic
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-02-28 14:57:35 +01:00
Lukas Wagner
8b3d568beb
server: add LDAP realm sync job
...
This commit adds sync jobs for LDAP user sync. As of now, they
can only be started manually.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-02-10 12:46:19 +01:00
Lukas Wagner
b6b18f65bc
api-types: add config options for LDAP user sync
...
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-02-10 12:46:19 +01:00
Lukas Wagner
dd67737942
api-types: add LDAP configuration type
...
The properties are mainly based on the ones from PVE, except:
* consistent use of kebab-cases
* `mode` replaces deprecated `secure`
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-02-10 12:46:19 +01:00
Wolfgang Bumiller
46e803256e
release proxmox-ldap to 0.1.0-1
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-02-10 10:42:40 +01:00
Wolfgang Bumiller
6dcdbd2bd1
bump proxmox-rest-server to 0.2.2-1
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-02-10 10:42:40 +01:00
Lukas Wagner
d696ad5bd1
rest-server: add handle_worker from backup debug cli
...
The function has now multiple users, so it is moved
here.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-02-10 10:23:41 +01:00
Wolfgang Bumiller
e8e8f83723
ldap: fixup d/control
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-02-08 14:30:52 +01:00
Wolfgang Bumiller
870be885ed
ldap: drop Ldap prefix from types that have it
...
for a bit more consistency and since we tend to repeat stuff
too much
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-02-08 14:29:12 +01:00