1
1
mirror of https://github.com/r4sas/PBinCLI synced 2025-03-13 05:41:08 +00:00

33 Commits

Author SHA1 Message Date
Fabio Manganiello
5e9a12ee92 Addressed comment: https://github.com/r4sas/PBinCLI/pull/53#discussion_r1965818035 2025-03-08 21:36:37 +03: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
88ea07dba2
json output for send command (closes #39)
Signed-off-by: R4SAS <r4sas@i2pmail.org>
2024-07-26 22:17:27 +03:00
3f30828e1a
handle errors when trying to get instance jsonld schema
Signed-off-by: R4SAS <r4sas@i2pmail.org>
2023-04-27 21:47:24 +03:00
8c5f93487a
set proxy and auth in API client session (#41)
Signed-off-by: R4SAS <r4sas@i2pmail.org>
2023-04-27 03:16:21 +03:00
46149f868b
authorization options (#41)
Signed-off-by: R4SAS <r4sas@i2pmail.org>
2023-04-26 04:43:10 +03:00
08dbceebc6
fix proxy usage with SOCKS (#40)
Signed-off-by: R4SAS <r4sas@i2pmail.org>
2023-04-06 22:48:11 +03:00
Georg
7bd3ef22b9
Reduce unhandled shortening exceptions (#35)
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2022-01-24 07:36:23 +03:00
b4ffc1a06b
[shortener] fix typos
Signed-off-by: R4SAS <r4sas@i2pmail.org>
2022-01-10 11:42:05 +03:00
82ca95f01a
implement custom shorter url support (#28)
Usage: set "--short-api" to "custom", provide url with "--short-url" to shorter
service which returns short link in text form. For paste url mask "{{url}}" must
be used. Link queried with GET request.

Example for Shlink service:
https://doma.in/rest/v2/short-urls/shorten?apiKey=YOURKEY&longUrl={{url}}&format=txt

Signed-off-by: R4SAS <r4sas@i2pmail.org>
2022-01-10 02:10:00 +03:00
6c9a5c95b6 add verbosity flag (-v), closes #32
Signed-off-by: r4sas <r4sas@i2pmail.org>
2021-06-04 20:13:51 +00:00
682b47fbd3
0.3.0
New:
* Added validation of PrivateBin instance URL - #18 (it must contain trailing slash because POST is used)
* URL shortener support with various supported services - #19
* Shortener configuration, certificate validation and insecure warning settings can be configured in config file or via env

Changed:
* Restructured some parts of code by splitting big code chunks in funtions (encrypt/decrypt)
* Rework error messaging repeatable code (moved in utils)
* Reduce code duplication (requests session configuring)

Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-20 10:50:06 +00:00
9d82c727b6
[shortener] move service-depend init code to functions
Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-20 06:12:10 +00:00
c425d86ed6
[shortener] remove not completed bitly support code
Anyone can request to add support later, so for now I removing that code due to lack of use.

Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-20 06:00:08 +00:00
ebfe0c48a0
[shortener] separate services related code in functions
Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-18 23:22:56 +00:00
45d854e590
[shortener] add is.gd, v.gd and cutt.ly services support
Start realisation of bitly support.

Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-18 21:09:16 +00:00
92c38344e3
add tinyurl support
Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-18 19:01:41 +00:00
b596f42b7e
fix response handler (closes #19)
Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-18 13:46:30 +00:00
86c5051fcf
move 'requests' configuration code in separate function
Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-18 12:02:41 +00:00
f838f8ee94
fix codacy issues
Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-18 11:43:44 +00:00
fb7a93732d
rewrite yourls response handler (#19)
Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-18 11:27:15 +00:00
c3a491ac46
correct response store for yourls (#19)
Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-18 10:14:44 +00:00
641c55a6a2
fix dict merging (#19)
Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-17 13:22:28 +00:00
432675f2e6
url shortener support (#19)
Currently tested only with clck.ru service. YOURLS test needed.

Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-17 10:54:58 +00:00
635c87dabd
[wip] url shortener support (#19)
Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-17 08:55:59 +00:00
6b6c33e545
[wip] url shortener support (#19)
Signed-off-by: r4sas <r4sas@i2pmail.org>
2019-09-17 05:22:57 +00:00
7fc2a1a625
add cert validation ignoring switches (closes #15) 2019-07-16 20:32:37 +00:00
dc034b1d55 update rst readme, remove unused import 2019-06-21 13:32:46 +00:00
85cc1454ea fixes 2019-06-21 13:12:17 +00:00
d37e573d9e little refactoring 2019-06-19 10:58:41 +00:00
f7fae450a0 [wip] v2 support code (#13) 2019-06-02 14:04:38 +00:00
l-n-s
5c8cdc97df factor out settings.py 2018-05-23 04:14:35 -04:00
l-n-s
c72a7c15f4 transports -> api 2018-05-23 03:41:17 -04:00