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

12625 hide datasource password #12743

Closed

Conversation

aroth01
Copy link

@aroth01 aroth01 commented May 26, 2023

Fixes: #12625

Change datasource.html to hide password until the "show secret" button is clicked. I have the permissions to view set for update/change/add instead of view. As if a user doesn't have view for core/datasource, they wouldn't be able to see the page anyways. Unless I'm misunderstanding something.

@@ -88,7 +89,18 @@ <h5 class="card-header">Backend</h5>
{% for name, field in object.get_backend.parameters.items %}
<tr>
<th scope="row">{{ field.label }}</th>
<td>{{ object.parameters|get_key:name|placeholder }}</td>
{% if field.label == "Password" and object.parameters|get_key:name %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is going to be a viable approach. We can't rely on the field label to infer whether the parameter should be displayed. (And even if we could, hard-coding this in the template should be considered poor practice.) We should devise some approach to explicitly set some attribute on the parameter itself to control its display.

@aroth01 aroth01 closed this May 26, 2023
@aroth01 aroth01 deleted the 12625-hide-datasource-password branch May 26, 2023 14:47
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Datasource passwords are displayed in plaintext
2 participants