mirror of https://github.com/01-edu/public.git
docs(credentials_searches): replace single quotes for backticks
This commit is contained in:
parent
3e7cd64c92
commit
dad3fd234a
|
@ -4,17 +4,17 @@
|
|||
|
||||
Create a file `credentials_searches.py` that contains a function `credentials_search` which takes no parameters and searches for the keys `password` and `secret` in a file called `logs.json`.
|
||||
|
||||
- If both keys are found, the function should create a new json file named 'credentials.json' and save the values of those keys in it.
|
||||
- If both keys are found, the function should create a new json file named `credentials.json` and save the values of those keys in it.
|
||||
|
||||
- If only one of the keys is found, the function should create a new json file named 'credentials.json' and save the value of that key in it.
|
||||
- If only one of the keys is found, the function should create a new json file named `credentials.json` and save the value of that key in it.
|
||||
|
||||
- If neither key is found, the function should not create the 'credentials.json' file.
|
||||
- If neither key is found, the function should not create the `credentials.json` file.
|
||||
|
||||
- If the 'logs.json' file is empty or is not a json file, the function should not create the 'credentials.json' file.
|
||||
- If the `logs.json` file is empty or is not a json file, the function should not create the `credentials.json` file.
|
||||
|
||||
- If the 'logs.json' file does not exist, the function should not create the 'credentials.json' file.
|
||||
- If the `logs.json` file does not exist, the function should not create the `credentials.json` file.
|
||||
|
||||
- If the keys are found in a nested object, the function should create the 'credentials.json' file and save the values of the keys in it.
|
||||
- If the keys are found in a nested object, the function should create the `credentials.json` file and save the values of the keys in it.
|
||||
|
||||
### Usage
|
||||
|
||||
|
@ -47,13 +47,13 @@ Your function should generate this file `credentials.json`:
|
|||
|
||||
### Hints
|
||||
|
||||
- The json module can be used to read and write JSON files.
|
||||
- The `json` module can be used to read and write JSON files.
|
||||
|
||||
- The os module can be used to check if a file exists and remove a file.
|
||||
- The `os` module can be used to check if a file exists and remove a file.
|
||||
|
||||
- Remember that the function should be able to search for the keys password and secret in nested json objects.
|
||||
- Remember that the function should be able to search for the keys `password` and `secret` in nested json objects.
|
||||
|
||||
- Using the isinstance function could be useful to check if a value is for example a dict.
|
||||
- Using the `isinstance` function could be useful to check if a value is for example a dict.
|
||||
|
||||
### References
|
||||
|
||||
|
|
Loading…
Reference in New Issue