Commit Graph

23 Commits

Author SHA1 Message Date
Thomas Lamprecht
6c42a1034b parse_sync_opts: code cleanup
avoid confusion between fmt default and cfg default

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-25 18:54:46 +02:00
Dominik Csapak
38691d98c8 domain sync: add 'dry-run' parameter
this can be used to test the resulting config before actually changing
anything

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-25 18:31:35 +02:00
Dominik Csapak
055c54b5a2 domain sync: make options actually required
we want the api options to be optional, but only as long as there are
default values set in the realm config

since they are all marked as optional (else they would be required in
the api) this check did not work as intended

instead, set the result to the value of:
* the parameter
* the set default in the config
* the api default
in this order

if it is undef after this, raise a parameter exception

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-25 18:31:35 +02:00
Thomas Lamprecht
89338e4d9c api/domain: add on add/update/delete hooks
Almost 1:1 taken from pve-storage ones

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-18 18:48:05 +02:00
Thomas Lamprecht
b49abe2d25 split and sort some module use
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-21 16:21:57 +01:00
Thomas Lamprecht
d29d2d4a11 realm: add default-sync-options to config
This allows us to have a convenient way to set the desired default
sync options, and thus not forcing users to pass always all options
when they want to trigger a sync.

We still die when an option is neither specified in the domains
(realm) config nor as API/CLI parameter.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-21 16:21:57 +01:00
Thomas Lamprecht
415179b03a api: realm sync: move out group and user update to separate methods
keep the api call way smaller and clearer

On moving out some minor adaptions where made, e.g., we do not print
"remove user X" if we know that we'd add it again, but just print a
single "update user X" for that. Same for groups.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-21 16:21:57 +01:00
Thomas Lamprecht
6a2138e4d6 api: realm sync: use auth-realm-sync as worker id
we may potentially also sync something else over this in the future,
for example PAM users from a specific group, so use a more general
	name.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-21 16:11:48 +01:00
Thomas Lamprecht
cf109814a8 api: realm sync: cleanup code and refactor
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-21 16:11:48 +01:00
Dominik Csapak
673d2bf267 api: domains: add user/group sync API enpoint
this api call syncs the users and groups from LDAP/AD to the
user.cfg

it also implements a 'full' mode where we first delete all
users/groups from the config and sync them again

the parameter 'enable' controls if newly synced users are 'enabled'
(if no sync parameter handles that)
the parameter 'purge' controls if ACLs get removed for users/groups
that do not exists anymore after

also add this command to pveum

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-03-21 16:05:15 +01:00
Dominik Csapak
f3c87f9b4e API2/Domains.pm: document 'type' return value
this way it gets printed with 'pveum realm list'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-03-07 19:50:22 +01:00
Dominik Csapak
32449f358e API2/Domains.pm: fix whitespace errors
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-03-07 19:50:22 +01:00
Dietmar Maurer
52b2eff3c5 PVE/API2/Domains.pm: fix property description 2017-01-11 12:11:01 +01:00
Dietmar Maurer
30be0de97a allow to write builtin auth domains
So that we can set tfa, comment, default with the GUI.
2014-07-18 11:30:19 +02:00
Dietmar Maurer
1abc2c0aee add oath two factor auth, bump version to 3.0-14 2014-07-17 14:04:13 +02:00
Dietmar Maurer
96f8ebd625 add basic support for two factor auth 2014-06-23 11:42:44 +02:00
Dietmar Maurer
5bb4e06a64 new plugin architecture for Auth modules 2012-05-22 10:43:30 +02:00
Dietmar Maurer
82b63965eb cleanup permission checks
Added new Real.AllocateUser priviledge
2012-01-27 08:34:12 +01:00
Dietmar Maurer
9691923469 fix access control 2012-01-24 11:50:41 +01:00
Dietmar Maurer
0c1563637a allow to pass emtpy strings to delete settings 2012-01-13 09:42:53 +01:00
Dietmar Maurer
af4a8a8522 allow port 0 to use default value 2012-01-13 09:13:41 +01:00
Dietmar Maurer
a0492cd61b added domain attribute for AD servers 2012-01-13 08:03:25 +01:00
Dietmar Maurer
2c3a6c0aaa iimported from svn 'pve-access-control/trunk' 2011-08-23 07:27:48 +02:00