public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Mira Limbeck <m.limbeck@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: Re: [pmg-devel] [PATCH pmg-api v7 7/12] api: users: create user with a specified realm
Date: Wed, 26 Feb 2025 13:51:56 +0100	[thread overview]
Message-ID: <66139273-9cc3-422c-b127-de12f8e7f235@proxmox.com> (raw)
In-Reply-To: <20250226113848.42829-8-m.frank@proxmox.com>



On 2/26/25 12:38, Markus Frank wrote:
> Signed-off-by: Markus Frank <m.frank@proxmox.com>
> ---
>  src/PMG/API2/Users.pm | 3 +++
>  src/PMG/UserConfig.pm | 1 -
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/PMG/API2/Users.pm b/src/PMG/API2/Users.pm
> index 42c82b7..834ae87 100644
> --- a/src/PMG/API2/Users.pm
> +++ b/src/PMG/API2/Users.pm
> @@ -111,6 +111,9 @@ __PACKAGE__->register_method ({
>  	    die "User '$param->{userid}' already exists\n"
>  		if $cfg->{$param->{userid}};
>  
> +	    die "Currently you cannot create user in the PAM realm\n"
> +		if $param->{realm} eq 'pam';
when creating the user via `pmgsh` no realm is required
if no realm is specified, it results in this:
```
pmg:/access/users> create --role audit --userid test123@oid-authentik
Use of uninitialized value in string eq at
/usr/share/perl5/PMG/API2/Users.pm line 115.
200 OK
```

since we specify a userid (username@realm), we could extract the realm
from the userid

> +
>  	    my $entry = {};
>  	    foreach my $k (keys %$param) {
>  		my $v = $param->{$k};
> diff --git a/src/PMG/UserConfig.pm b/src/PMG/UserConfig.pm
> index fe6d2c8..9a6f142 100644
> --- a/src/PMG/UserConfig.pm
> +++ b/src/PMG/UserConfig.pm
> @@ -141,7 +141,6 @@ my $schema = {
>  
>  our $create_schema = clone($schema);
>  delete $create_schema->{properties}->{username};
> -delete $create_schema->{properties}->{realm};
>  $create_schema->{properties}->{password} = {
>      description => "Password",
>      type => 'string',



_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel


  reply	other threads:[~2025-02-26 12:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-26 11:38 [pmg-devel] [PATCH perl-rs/pmg-api/widget-toolkit/pmg-gui v7 0/12] fix #3892: OpenID Connect Markus Frank
2025-02-26 11:38 ` [pmg-devel] [PATCH proxmox-perl-rs v7 1/12] move openid code from pve-rs to common Markus Frank
2025-02-26 11:38 ` [pmg-devel] [PATCH proxmox-perl-rs v7 2/12] remove empty PMG::RS::OpenId package to avoid confusion Markus Frank
2025-02-26 11:38 ` [pmg-devel] [PATCH pmg-api v7 3/12] config: add plugin system for authentication realms Markus Frank
2025-02-26 11:38 ` [pmg-devel] [PATCH pmg-api v7 4/12] config: add oidc type authentication realm Markus Frank
2025-02-26 11:38 ` [pmg-devel] [PATCH pmg-api v7 5/12] api: add/update/remove authentication realms like in PVE Markus Frank
2025-02-26 11:38 ` [pmg-devel] [PATCH pmg-api v7 6/12] api: oidc login similar to PVE Markus Frank
2025-02-26 11:38 ` [pmg-devel] [PATCH pmg-api v7 7/12] api: users: create user with a specified realm Markus Frank
2025-02-26 12:51   ` Mira Limbeck [this message]
2025-02-26 11:38 ` [pmg-devel] [PATCH widget-toolkit v7 08/12] fix: window: AuthEditBase: rename variable 'realm' to 'type' Markus Frank
2025-02-26 11:38 ` [pmg-devel] [PATCH widget-toolkit v7 09/12] panel: AuthView: change API path in pmx-domains model Markus Frank
2025-02-26 11:38 ` [pmg-devel] [PATCH widget-toolkit v7 10/12] form: RealmComboBox: add option to change the API path Markus Frank
2025-02-26 11:38 ` [pmg-devel] [PATCH pmg-gui v7 11/12] login: add option to login with OIDC realm Markus Frank
2025-02-26 11:38 ` [pmg-devel] [PATCH pmg-gui v7 12/12] add realms panel to user management Markus Frank

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66139273-9cc3-422c-b127-de12f8e7f235@proxmox.com \
    --to=m.limbeck@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal