Skip to content

Commit

Permalink
Merge pull request #596 from NethServer/fix-bud
Browse files Browse the repository at this point in the history
Fix bind-user-domains with empty domain list
  • Loading branch information
DavidePrincipi authored Mar 4, 2024
2 parents fce7b1c + d374787 commit 7e4b361
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ if not is_included:
print(agent.SD_WARNING + f"Error: the domain_list {domain_list} is not included in the list of domains {domains}", file=sys.stderr)
sys.exit(3)

rdb.hset(f'cluster/module_domains', module_id, " ".join(domain_list))
if domain_list:
rdb.hset(f'cluster/module_domains', module_id, " ".join(domain_list))
else:
rdb.hdel(f'cluster/module_domains', module_id)

union_domains = set(domain_list) | set(previous_domains.split())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"domains": {
"description": "One or more domains to bind with the module calling this action",
"type": "array",
"minItems": 1,
"items": {
"description": "A user domain name",
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import cluster.grants
rdb = agent.redis_connect(privileged=True)

#
# Update existing grants for features #6814, #6825
# Update existing grants for features #6814, #6825, #6852
#
cluster.grants.grant(rdb, action_clause="bind-user-domains", to_clause="accountconsumer", on_clause='cluster')
cluster.grants.grant(rdb, action_clause="bind-user-domains", to_clause="accountprovider", on_clause='cluster')
cluster.grants.grant(rdb, action_clause="list-modules", to_clause="accountprovider", on_clause='cluster')

#
Expand Down
1 change: 1 addition & 0 deletions core/imageroot/var/lib/nethserver/node/install-finalize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ cluster.grants.grant(rdb, action_clause="remove-custom-zone", to_clause="tunadm
cluster.grants.grant(rdb, action_clause="update-routes", to_clause="accountprovider", on_clause='cluster')
cluster.grants.grant(rdb, action_clause="bind-user-domains", to_clause="accountconsumer", on_clause='cluster')
cluster.grants.grant(rdb, action_clause="bind-user-domains", to_clause="accountprovider", on_clause='cluster')
cluster.grants.grant(rdb, action_clause="list-modules", to_clause="accountprovider", on_clause='cluster')
EOF

Expand Down

0 comments on commit 7e4b361

Please sign in to comment.