Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-133012 / 25.04 / Fix API keys for restricted admins #15288

Merged
merged 1 commit into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/middlewared/middlewared/api/v25_04_0/api_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ApiKeyEntry(BaseModel):


class ApiKeyEntryWithKey(ApiKeyEntry):
key: Secret[str]
key: str


class ApiKeyCreate(ApiKeyEntry):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%
from middlewared.utils import filter_list
from middlewared.utils.auth import LEGACY_API_KEY_USERNAME
from middlewared.utils.pam import STANDALONE_AUTH
from middlewared.utils.pam import STANDALONE_ACCOUNT

ds_auth = render_ctx['datastore.config']['stg_ds_auth']
truenas_admin_string = ''
Expand Down
2 changes: 1 addition & 1 deletion tests/api2/test_api_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def test_api_key_crud_restricted_admin_own_keys(sharing_admin_user):
})
assert 'key' not in updated
updated = c.call('api_key.update', key_info['id'], {'reset': True})
assert updated['key'] is not '********'
assert updated['key'] != '********'
finally:
c.call('api_key.delete', key_info['id'])

Expand Down
Loading