Skip to main content

Gitguardian Python SDK 1.0.0

Welcome to the Gitguardian SDK documentation. This guide will help you get started with integrating and using the Gitguardian SDK in your project.

Versions

  • API version: 1.1.0
  • SDK version: 1.0.0

About the API

Introduction Whether you want to build a complete integration with your software development workflow or simply want to test GitGuardian's policy break detection on any text content, you can use our API. - The base url for the latest version is api.gitguardian.com/v1 over HTTPS. - All data is sent and received as JSON by default. - All timestamps returned are ISO-8601 compliant, example: python 2020-03-16T04:46:00+00:00 # for date-time GitGuardian supported wrappers: - Python: py-gitguardian GitGuardian provides you with GitGuardian Shield, a CLI application that uses the GitGuardian API through py-gitguardian to scan your files and detect potential secrets or issues in your code. This CLI application can be used in many CIs (such as GitHub Actions, GitLab Pipelines, CircleCI,...) or as a pre-commit or pre-receive hook. # Authentication The GitGuardian API uses API keys to authenticate requests. For a detailed explanation, please refer to our dedicated documentation. Use /v1/health to check the validity of your token if needed. # Pagination The GitGuardian API employs cursor-based pagination. For a detailed explanation, please refer to our dedicated documentation.

Table of Contents

Setup & Configuration

Supported Language Versions

This SDK is compatible with the following versions: Python >= 3.7

Installation

To get started with the SDK, we recommend installing using pip:

pip install gitguardian-client

Authentication

Access Token Authentication

The Gitguardian API uses an Access Token for authentication.

This token must be provided to authenticate your requests to the API.

Setting the Access Token

When you initialize the SDK, you can set the access token as follows:

Gitguardian(
access_token="YOUR_ACCESS_TOKEN"
)

If you need to set or update the access token after initializing the SDK, you can use:

sdk.set_access_token("YOUR_ACCESS_TOKEN")

Services

The SDK provides various services to interact with the API.

Below is a list of all available services with links to their detailed documentation:

Models

The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently.

Below is a list of all available models with links to their detailed documentation:
NameDescription
ApiTokenDetailsDetails of an API Token
ApiTokenStatusEnum
ApiTokenScopeEnum
ListApiTokensOrdering
PublicJwtCreateRequest
PublicJwtCreateOkResponse
IncidentWithoutOccurrences
StatusEnum
SeverityEnum
ValidityEnum
ListIncidentsOrdering
Incident
RetrieveIncidentsLeaksOkResponse
AssignIncidentRequest
ResolveIncidentRequest
IgnoreIncidentRequest
ShareIncidentRequest
IncidentToken
GrantAccessIncidentRequest
RevokeAccessIncidentRequest
IncidentMember
IncidentPermissionEnum
MemberAccessLevelEnum
IncidentTeam
IncidentInvitation
Member
ListSecretIncidentMemberAccessOrdering
Team
Invitation
ListSecretIncidentInvitationAccessOrdering
ListSourcesIncidentsOrdering
ListTeamIncidentsOrdering
IncidentNote
ListIncidentNotesOrdering
CreateIncidentNoteRequest
UpdateIncidentNoteRequest
VcsOccurrence
SourceTypeQueryParamsEnum
PresenceEnum
ListOccsOrdering
ListInvitationsOrdering
CreateInvitationsRequest
ResendInvitationOkResponse
ResourceInvitationAccess
ResourceType
ListInvitationSecretIncidentAccessOrdering
ListMembersOrdering
ResourceMemberAccess
ListMemberSecretIncidentAccessOrdering
TeamMembership
Document
ScanResultResult of a content scan.
DetectorGroup
DetectorGroupTypeEnum
ListSecretDetectorsOrdering
Quota
ScanIacRequest
IacScanResult
DiffScanIacRequest
IacDiffScanResult
Source
ScanStatusEnum
SourceHealthEnum
ListSourcesOrdering
ListSourcesVisibilityFilter by visibility status.
SourceCriticalityFilter by source criticality.
AuditLog
HealthCheckOkResponseHealth check response.
CreateTeamsRequest
ResourceTeamAccess
ListTeamSecretIncidentAccessOrdering
TeamInvitation
TeamPermissionEnum
CreateTeamInvitationsRequest
UpdateTeamInvitationRequest
UpdateTeamMembershipRequest
TeamRequest
AcceptTeamRequestRequest
ListTeamSourcesTypeFilter by integration type.
ListTeamSourcesOrdering
ListTeamSourcesVisibilityFilter by visibility status.
UpdateTeamSourcesRequest
Honeytoken
ListHoneytokenStatusStatus of a honeytoken.
ListHoneytokenTypeType of a honeytoken.
ListHoneytokenOrdering
CreateHoneytokenRequest
CreateHoneytokenWithContextRequest
HoneyTokenWithContext
UpdateHoneytokenRequest
HoneyTokenNote
ListHoneytokenNotesOrdering
CreateHoneytokenNoteRequest
UpdateHoneytokenNoteRequest
HoneyTokenSource
ListHoneytokenSourcesOrdering
HoneyTokenEvent
ListHoneytokensEventsOrdering
ListHoneytokensEventsStatus
HoneyTokenLabel
CreateHoneytokenLabelRequest
PatchHoneytokenLabelRequest
ComputeScaFilesOkResponse
ScaScanAllRequest
ScaScanAllOkResponse
ScaScanDiffRequest
ScaScanDiffOkResponse
ApiTokenTypeEnum
Detector
SecretStatusEnum
TagEnum
OccurrenceKindEnum
Match
SecretIncidentsBreakdownDetailed count of secret incidents linked to this source.
Scan
SourceSeverityBreakdown
SeverityBreakdown
HmslSourceTypeEnum
NonOwnerMemberAccessLevelEnum
PolicyBreakIssue found in your Document
ValidityValidity of the found secret.
Matches
Content
IacScanTarParameters
SeverityEnumIac
EntitiesWithIncidents
Incidents
IacStatusEnum
IacDiffScanResultEntitiesWithIncidents
AuditLogActionTypeEnum
HoneytokenStatusStatus of the honeytoken.
HoneytokenTypeType of the honeytoken.
HoneyTokenEventTag
CreateHoneytokenRequestTypehoneytoken type
CreateHoneytokenWithContextRequestTypeHoneytoken type.
HoneyTokenSourceType
HoneyTokenEventStatusStatus of the honeytoken event.
ScaScanTarParameters
ScaIgnoredVulnerability
LocationOutputSchema
PackageVulnerabilityOutputSchema
DependencyTypeEnum
ExposedVulnerabilityOutputSchema

License

This SDK is licensed under the MIT License.

See the LICENSE file for more details.

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →