Skip to content

Latest commit

 

History

History
278 lines (193 loc) · 8.63 KB

File metadata and controls

278 lines (193 loc) · 8.63 KB

stratum.ConsentApi

All URIs are relative to http://localhost:3000

Method HTTP request Description
grant_consent POST /api/v1/tenants/{tenantId}/consent Grant consent
list_consent GET /api/v1/tenants/{tenantId}/consent List consent records
revoke_consent DELETE /api/v1/tenants/{tenantId}/consent/{purpose} Revoke consent

grant_consent

ConsentRecord grant_consent(tenant_id, grant_consent_input)

Grant consent

Grant a consent record for a subject within a tenant.

Example

  • Api Key Authentication (apiKey):
  • Bearer (JWT) Authentication (bearerAuth):
import stratum
from stratum.models.consent_record import ConsentRecord
from stratum.models.grant_consent_input import GrantConsentInput
from stratum.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = stratum.Configuration(
    host = "http://localhost:3000"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiKey
configuration.api_key['apiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKey'] = 'Bearer'

# Configure Bearer authorization (JWT): bearerAuth
configuration = stratum.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with stratum.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = stratum.ConsentApi(api_client)
    tenant_id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    grant_consent_input = stratum.GrantConsentInput() # GrantConsentInput | 

    try:
        # Grant consent
        api_response = api_instance.grant_consent(tenant_id, grant_consent_input)
        print("The response of ConsentApi->grant_consent:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ConsentApi->grant_consent: %s\n" % e)

Parameters

Name Type Description Notes
tenant_id UUID
grant_consent_input GrantConsentInput

Return type

ConsentRecord

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Created consent record -
400 Validation error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_consent

List[ConsentRecord] list_consent(tenant_id, subject_id=subject_id)

List consent records

List consent records for a tenant, optionally filtered by subject.

Example

  • Api Key Authentication (apiKey):
  • Bearer (JWT) Authentication (bearerAuth):
import stratum
from stratum.models.consent_record import ConsentRecord
from stratum.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = stratum.Configuration(
    host = "http://localhost:3000"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiKey
configuration.api_key['apiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKey'] = 'Bearer'

# Configure Bearer authorization (JWT): bearerAuth
configuration = stratum.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with stratum.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = stratum.ConsentApi(api_client)
    tenant_id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    subject_id = 'subject_id_example' # str | Filter by subject ID (optional)

    try:
        # List consent records
        api_response = api_instance.list_consent(tenant_id, subject_id=subject_id)
        print("The response of ConsentApi->list_consent:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ConsentApi->list_consent: %s\n" % e)

Parameters

Name Type Description Notes
tenant_id UUID
subject_id str Filter by subject ID [optional]

Return type

List[ConsentRecord]

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 List of consent records -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

revoke_consent

SuccessResponse revoke_consent(tenant_id, purpose, subject_id)

Revoke consent

Revoke a consent record for a specific subject and purpose.

Example

  • Api Key Authentication (apiKey):
  • Bearer (JWT) Authentication (bearerAuth):
import stratum
from stratum.models.success_response import SuccessResponse
from stratum.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = stratum.Configuration(
    host = "http://localhost:3000"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: apiKey
configuration.api_key['apiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKey'] = 'Bearer'

# Configure Bearer authorization (JWT): bearerAuth
configuration = stratum.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with stratum.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = stratum.ConsentApi(api_client)
    tenant_id = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | 
    purpose = 'purpose_example' # str | 
    subject_id = 'subject_id_example' # str | Subject ID (required)

    try:
        # Revoke consent
        api_response = api_instance.revoke_consent(tenant_id, purpose, subject_id)
        print("The response of ConsentApi->revoke_consent:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ConsentApi->revoke_consent: %s\n" % e)

Parameters

Name Type Description Notes
tenant_id UUID
purpose str
subject_id str Subject ID (required)

Return type

SuccessResponse

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Consent revoked -
400 Missing subject_id parameter -
404 Consent record not found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]