semvec/pypi-packages huggingface dataset:
featurebase 0.1.0
A client library for Featurebase.
Requires Python: >=3.7

# python-featurebase

Python client for Featurebase SQL endpoint.

For more complete documentation, see:

https://docs.featurebase.com/docs/tools/python-client-library/python-client-library-home/

# Client Library Usage:

First install the python-featurebase package. Running `make` from project folder
will build and install the package. After installing the package you can try
executing queries as shown in the following examples:

    import featurebase

    # assuming featurebase runs at "localhost:10101"
    # for cloud, pass hostport="query.featurebase.com/v2", database="<database_id>", apikey="<APIKey_secret>"
    # create client
    client = featurebase.client()

    # query the endpoint with SQL
    try:
        result = client.query("SELECT * from demo;")
        print(result.data)
    except Exception as e:
        # SQL errors and connection errors both come back as exceptions
        print(e)

    # query the endpoint with a batch of SQLs, running the SQLs synchronously
    # Synchronous run best suited for executing DDL and DMLs that need to follow specific run order
    # passing the optional parameter "stoponerror=True" will stop execution at the failed SQL and the remaining SQLs in the list will not be executed. 
    sqllist=[]
    sqllist.append("CREATE TABLE demo1(_id id, i1 int);")
    sqllist.append("INSERT INTO demo1(_id, i1) VALUES(1, 100);")
    sqllist.append("INSERT INTO demo1(_id, i1) VALUES(2, 200);")
    sqllist.append("select * from demo1;")
    results = client.querybatch(sqllist, stoponerror=True)
    for result in results:
        print(result.data)
        
    # query the endpoint with a batch of SQLs, running the SQLs Asynchronously
    # Asynchronous run best suited for running SELECT queries that can be run concurrently.
    sqllist=[]
    sqllist.append("SELECT * from demo1;")
    sqllist.append("SELECT count(*) from demo1;")
    sqllist.append("SELECT max(i1) from demo1;")
    results = client.querybatch(sqllist, asynchronous=True)
    for result in results:
        print(result.data)
authcodecatcher 0.1.1
A server to catch Microsoft Entra OAuth codes and exchange them for a JWT token.
Requires Python: >=3.10

# authcodecatcher
A server for exchanging OAuth Codes for Tokens

## Description
If an open or hijackable redirect URI is discovered for an entra application, authcodecatcher can serve as a server at the hijackable URL to catch auth codes and exchange them for tokens. The user will be redirected to the configurable landing page. PKCE is supported.

## Installation
```
pip install authcodecatcher
```

## Usage
First, an SSL certificate needs to be created if you don't have one already
```
openssl req -new -x509 -keyout cert.pem -out cert.pem -days 365 -nodes
```

Next, run the module with the required arguments
```
python3 -m authcodecatcher.server --client-id <ID of hijackable app registration> --tenant-id <target tenant ID> --redirect-uri <The hijackable URI that you control> --port <The port to listen on> --cert-file <The PEM certificate file created in the previous step>
```

Lastly, generate a URL that will be sent to the target
```
curl https://localhost:1337/generateurl
```

The output will be JSON with a URL that contains the authorization endpoint. If an authenticated user navigates to this URL, authcodecatcher will obtain the auth code and exchange it for an access token. All access tokens are saved to a JSON file 'tokens.json' by default.

## Command Options
### --redirect-uri
The hijackable URI that the attacker controls. Must be listed in the application registration.
### --scope
The requested scope of the JWT. Defaults to *https://graph.microsoft.com/.default+offline_access*
### --urlpath
The path of the redirect-uri. For example, if the redirect-uri is *https://test.example.com/oauth/token*, then the --urlpath should be set to */oauth/token*.
### --port
The port on which the server will listen
### --client-id
The client ID (application ID) of the targeted Entra application.
### --tenant-id
The target tenant ID
### --output-file
The file that authcodecatcher will write tokens and pkce codes to.
### --cert-file
The certificate file to use for SSL
### --landing-page
The page that the user will be redirected to after the code exchange. Defaults to *https://en.wikipedia.org/wiki/Snallygaster*.