-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate random password for Grafana (#2289)
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import base64 | ||
|
||
import pytest | ||
import requests | ||
|
||
from tests.tests_deployment import constants | ||
|
||
|
||
@pytest.mark.filterwarnings("ignore::urllib3.exceptions.InsecureRequestWarning") | ||
def test_grafana_api_not_accessible_with_default_credentials(): | ||
"""Making sure that Grafana's API is not accessible on default user/pass""" | ||
user_pass_b64_encoded = base64.b64encode(b"admin:prom-operator").decode() | ||
response = requests.get( | ||
f"https://{constants.NEBARI_HOSTNAME}/monitoring/api/datasources", | ||
headers={"Authorization": f"Basic {user_pass_b64_encoded}"}, | ||
verify=False, | ||
) | ||
assert response.status_code == 401 |