simple-salesforce-extends
About
This package extends the simple-salesforce package to support the use of AWS Secrets Manager to store the Salesforce credentials.
API request with the stored token if hold the token.
If the token is expired, re-authenticate and store the new token.
Required
- Python 3.11+
- simple-salesforce
- boto3
Install
$ pip install simple-salesforce-extends
Prepare
Create a secret in AWS Secrets Manager with the following format:
{
"Domain": "yourdomain.my",
"ConsumerKey": "3MV.....",
"ConsumerSecret": "1234ABCD...."
}
Usage
import boto3
from simple_salesforce_extends import SalesforceClientCredential
sfdc_credential_secrets_arn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:your-secret-arn"
secrets_client = boto3.client("secretsmanager", region_name="us-east-1")
sf = SalesforceClientCredential(
secrets_client=secrets_client,
credentials_secrets_manager_arn=sfdc_credential_secrets_arn,
)
soql = "SELECT Id, Name FROM Account LIMIT 1"
result = sf.query(soql)
print(result["records"][0])
Test
$ python -m unittest discover -s src/
Metadata
Release files for simple-salesforce-extends 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simple-salesforce-extends-0.2.0.tar.gz | 4.2 kB | Without provenance | Details for simple-salesforce-extends-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simple_salesforce_extends-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for simple_salesforce_extends-0.2.0-py3-none-any.whl |
Total release size: 9.7 kB
Release files / simple-salesforce-extends-0.2.0.tar.gz
| Download URL | simple-salesforce-extends-0.2.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
083f0b2f48e50baf296b02f4f96a6057de3aa7bc3e711eb53619c63a3df994ef
|
|
BLAKE2b-256 checksum How to use checksums |
979bfa0633eb067a4481d0b020b3706fc38a5fd1ea6a62524fa94d3389fadffc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.6
|
Release files / simple_salesforce_extends-0.2.0-py3-none-any.whl
| Download URL | simple_salesforce_extends-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
588fdec2a1b3592de5f3dcc2d2489206e277eac863063374a18e29d8148d7b5b
|
|
BLAKE2b-256 checksum How to use checksums |
9f86c66c4f3a3571eb9fa43d626282841704939e71992e0fe44edf2d539269db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.6
|
Security for simple-salesforce-extends 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.