1
1
mirror of https://github.com/r4sas/PBinCLI synced 2025-08-26 05:32:01 +00:00
Fabio Manganiello 03bdfe6782 A more robust logic to parse API settings.
All key-value settings in api.py were parsed through the following syntax:

```python
if settings["something"] is None:
  ...
```

This is problematic because it forces downstream implementations to also
provide all the fields, also when they are not required.

In particular, when new fields are added, downstream implementations
also have to provide them, or the integration will break.

The `settings.get("something")` syntax should be preferred, and settings
itself should also be initialized to a dict by default to prevent
dereferencing a `None` (I mean, if no settings are provided at all the
code should probably still break, but with a relevant error instead of a
fuzzier `TypeError`).

Closes: #51
Closes: #52
Closes: https://github.com/Pioverpie/privatebin-api#12
2025-03-08 21:36:37 +03:00
..
2025-02-15 20:16:39 +03:00
2025-02-15 20:06:37 +03:00