Skip to main content

An unofficial module for integrating with SenhaSegura APIs, supporting OAuth1 and OAuth2 authentication. It offers a simple interface for making HTTP requests while ensuring hostname and endpoint validation. Ideal for developers looking to implement password management functionalities securely.

Project description

SenhaSegura

Overview

The A2A module provides an unofficial interface for interacting with the SenhaSegura APIs. This module simplifies the integration of password management functionalities into your applications by offering support for both OAuth1 and OAuth2 authentication methods.

Features

Support for HTTP Methods: Easily make GET, POST, PUT, DELETE, HEAD, OPTIONS, and PATCH requests. Hostname Validation: Ensures that the provided hostname follows standard DNS rules. Endpoint Validation: Validates endpoint strings to prevent malformed URLs. Dynamic Method Binding: All HTTP methods are dynamically bound, allowing for intuitive usage. OAuth Authentication: Supports OAuth1 and OAuth2 for secure API access. Error Handling: Comprehensive error handling for authentication and request parameters.

Installation

You can use the SenhaSegura using one of the following methods:

pip: pip install senhasegura Git: git clone https://github.com/SrRenks/senhasegura.git

Usage

Initialize the A2A Class: To create an instance of the A2A module, specify the hostname and authentication parameters:

from senhasegura import A2A
import json
with open("oauth1_params.json", "r") as file:
    oauth1_params = json.loads(file.read())
a2a = A2A("senhasegura.yourcompany.com", "OAuth1", **oauth1_params)

Make API Calls: Use the instance to call API endpoints with the desired HTTP method:

response = a2a.get("/iso/coe/senha", params={"123": 123}, headers={"User-Agent": "example"})

Handle the Response: You can process the requests.Response as needed:

print(response.json())

Example

Here's a complete example of using the A2A module:

from senhasegura import A2A
import json

# Load OAuth1 parameters from a JSON file
with open("oauth1_params.json", "r") as file:
    oauth1_params = json.loads(file.read())

# Initialize with your credentials
a2a = A2A("senhasegura.yourcompany.com", "OAuth1", **oauth1_params)

# Make a GET request
response = a2a.get("/iso/coe/senha", params={"123": 123}, headers={"User-Agent": "example"})

# Print the response
print(response.json())

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or features you would like to see.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

senhasegura-0.1.3.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

senhasegura-0.1.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file senhasegura-0.1.3.tar.gz.

File metadata

  • Download URL: senhasegura-0.1.3.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.2 Linux/6.1.0-28-amd64

File hashes

Hashes for senhasegura-0.1.3.tar.gz
Algorithm Hash digest
SHA256 03c98a3e860ea6c7af4b9448d1585325ba085db9d33bcbfa0e3f06b68f33e445
MD5 b49eef472bbc226d2cb8ff8ce0c240df
BLAKE2b-256 7fd887a297347384d2002ab1e55941a217d46bc5a1f3a138a858ac31bcd778a6

See more details on using hashes here.

File details

Details for the file senhasegura-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: senhasegura-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.2 Linux/6.1.0-28-amd64

File hashes

Hashes for senhasegura-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 21a4b36dc749e2f98b0b7bf650779ed4d693da15a5e84860d635fa8e15849fd5
MD5 2391cb99a5fc42989fcd70bde3dee32b
BLAKE2b-256 607af5b138f836440c27c442da38e1cc2402df85a70a6e21678c55c54c03dec2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page