Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

alphabotsec/secbot-client-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SecBot Java Client (under development)

Automatically generated Java based client for the SecBot REST API. Please note that the SecBot API is currently under development and might change anytime.

Requirements

Java 1.8 or later. Building the API client library requires Maven to be installed.

Installation

To install the API client library to your local Maven repository, simply execute:

mvn install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn deploy

Refer to the official documentation for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
    <groupId>com.alphabot.secbot</groupId>
    <artifactId>secbot-client-java</artifactId>
    <version>0.0.2</version>
    <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "com.alphabot.secbot:secbot-client-java:0.0.2"

Others

At first generate the JAR by executing:

mvn package

Then manually install the following JARs:

  • target/secbot-client-java-0.0.2.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import com.alphabot.secbot.client.v0.*;
import com.alphabot.secbot.client.v0.auth.*;
import com.alphabot.secbot.client.v0.codegen.model.*;
import com.alphabot.secbot.client.v0.codegen.SecBotApi;

import java.io.File;
import java.util.*;

public class SecBotApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = new ApiClient().setBasePath("https://PATH_TO_YOUR_SECBOT_INSTANCE");
        
        // Configure API key authorization: Bearer
        ApiKeyAuth Bearer = (ApiKeyAuth) defaultClient.getAuthentication("Bearer");
        Bearer.setApiKey("YOUR API KEY");
        Bearer.setApiKeyPrefix("Bearer");

        SecBotApi apiInstance = new SecBotApi(defaultClient);
        String projectId = "projectId_example"; // String | 
        String environmentId = "environmentId_example"; // String | 
        String testRunId = "testRunId_example"; // String | 
        try {
            TestRunApiResponse result = apiInstance.getTestRunById(projectId, environmentId, testRunId);
            System.out.println(result);
        } catch (Exception e) {
            System.err.println("Exception when calling SecBotApi#getTestRunById");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://localhost

Class Method HTTP request Description
getLastTestRun GET /Api/v0/Project/{projectId}/Env/{environmentId}/LastRun
getTestRunById GET /Api/v0/Project/{projectId}/Env/{environmentId}/Run/{testRunId}
startTestRun POST /Api/v0/Project/{projectId}/Env/{environmentId}/start

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

Bearer

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

(c) 2017 Alphabot Security

About

Java based client for the SecBot REST API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages