credsweeper.validations package¶
Submodules¶
credsweeper.validations.apply_validation module¶
- class credsweeper.validations.apply_validation.ApplyValidation[source]¶
Bases:
object
Class that allow parallel API validation using already declared pool.
- validate(cred)[source]¶
Iterate over all validations in current cred.
If any validation results in VALIDATED_KEY - final result is VALIDATED_KEY If no VALIDATED_KEY, but at least one INVALID_KEY - final result is INVALID_KEY UNDECIDED otherwise
- Parameters:
cred (
Candidate
) – one candidate to validation- Return type:
credsweeper.validations.github_token_validation module¶
- class credsweeper.validations.github_token_validation.GithubTokenValidation[source]¶
Bases:
Validation
Validation of GitHub Access Token.
Personal access token validation: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
- classmethod verify(line_data_list)[source]¶
Verify GitHub Access Token.
Based on GitHub REST api documentation: https://docs.github.com/en/rest/overview/resources-in-the-rest-api
credsweeper.validations.google_api_key_validation module¶
- class credsweeper.validations.google_api_key_validation.GoogleApiKeyValidation[source]¶
Bases:
Validation
Validation of Google API Key.
- classmethod verify(line_data_list)[source]¶
Verify Google API Key of Google Maps Platform products.
Based on Google Map Place Search API: https://developers.google.com/places/web-service/search
credsweeper.validations.google_multi_validation module¶
- class credsweeper.validations.google_multi_validation.GoogleMultiValidation[source]¶
Bases:
Validation
Validation of Google Multi token.
- classmethod verify(line_data_list)[source]¶
Verify Google Multi token.
Multi token consisting of value with pattern - ‘CLIENT_ID.apps.googleusercontent.com’ and ‘client_secret’ with regex ‘AIza[0-9A-Za-z\-_]{35}’
Based on Google Ad Manager refresh token generator: https://github.com/googleads/googleads-python-lib/blob/master/examples/ad_manager/authentication/generate_refresh_token.py
credsweeper.validations.mailchimp_key_validation module¶
- class credsweeper.validations.mailchimp_key_validation.MailChimpKeyValidation[source]¶
Bases:
Validation
Validation of MailChimp Key.
- classmethod verify(line_data_list)[source]¶
Verify MailChimp Key - Authentication request to the MailChimp Marketing API.
Based on official API tutorial https://mailchimp.com/developer/marketing/guides/quick-start/
credsweeper.validations.slack_token_validation module¶
- class credsweeper.validations.slack_token_validation.SlackTokenValidation[source]¶
Bases:
Validation
Validation of Slack Token.
- classmethod verify(line_data_list)[source]¶
Verify Slack Token - Authentication token bearing required scopes.
Based on slack api documentation: api.slack.com/methods/auth.test api.slack.com/web
credsweeper.validations.square_access_token_validation module¶
- class credsweeper.validations.square_access_token_validation.SquareAccessTokenValidation[source]¶
Bases:
Validation
Validation of Square Access Token.
- classmethod verify(line_data_list)[source]¶
Verify Square Access Token.
Square Access Token - Scoped access token, Grants seller-scoped and limited access to a Square account by asking an authenticated user for explicit permissions.
Based on Square API docs: https://developer.squareup.com/docs/get-started Note that if you want to test it yourself you need to select Production API key, not the Sandbox one
credsweeper.validations.square_client_id_validation module¶
- class credsweeper.validations.square_client_id_validation.SquareClientIdValidation[source]¶
Bases:
Validation
Validation of Square Client ID.
- classmethod verify(line_data_list)[source]¶
Verify Square Client ID.
The Square issued ID for application, available from the developer dashboard.
Based on Square OAuth API docs: https://developer.squareup.com/reference/square/oauth-api/authorize
credsweeper.validations.stripe_api_key_validation module¶
- class credsweeper.validations.stripe_api_key_validation.StripeApiKeyValidation[source]¶
Bases:
Validation
Stripe API Key validation.
- classmethod verify(line_data_list)[source]¶
Verify Stripe API Key - API keys uses to authenticate requests.
Based on Stripe Authentication documentation: https://stripe.com/docs/api/authentication
credsweeper.validations.validation module¶
- class credsweeper.validations.validation.Validation[source]¶
Bases:
ABC
Abstract class for verify method
- abstract classmethod verify(line_data_list)[source]¶
Verify line_data_list with external API.