Skip to content

evangoncalves/sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for sdk

This is a senhasegura new API design

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 2.0.22
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://senhasegura.com

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import sdk "github.com/GIT_USER_ID/GIT_REPO_ID"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), sdk.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), sdk.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), sdk.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sdk.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://localhost

Class Method HTTP request Description
ApplicationDataManagementApi RegisterCloudProfile Post /iso/dsm/v2/applications/{application_id}/profiles/cloud Register Cloud Profiles on an Application
ApplicationDataManagementApi RegisterPAMProfile Post /iso/dsm/v2/applications/{application_id}/profiles/pam Register PAM Profiles on an Application
ApplicationDataManagementApi RemoveCloudProfile Delete /iso/dsm/v2/applications/{application_id}/profiles/cloud/{profile_name} Remove a Cloud Profile from an Application
ApplicationDataManagementApi RemovePAMProfile Delete /iso/dsm/v2/applications/{application_id}/profiles/pam/{profile_name}/{profile_target} Remove a PAM Profile from an Application
ApplicationManagementApi CreateApplication Post /iso/dsm/v2/applications Create Applications
ApplicationManagementApi DeleteApplication Delete /iso/dsm/v2/applications/{application_id} Delete/Disable an Application
ApplicationManagementApi GetApplication Get /iso/dsm/v2/applications/{application_id} Get an Application
ApplicationManagementApi ListApplication Get /iso/dsm/v2/applications List Applications
ApplicationManagementApi UpdateApplication Put /iso/dsm/v2/applications/{application_id} Update an Application
AuthorizationDataManagementApi RegisterSecret Post /iso/dsm/v2/applications/{application_id}/authorizations/{authorization_id}/secrets Register Secrets on an Authorization for an Application
AuthorizationDataManagementApi RemoveSecret Delete /iso/dsm/v2/applications/{application_id}/authorizations/{authorization_id}/secrets/{secret_id} Remove a Secret from an Authorization for an Application
AuthorizationManagementApi CreateAuthorization Post /iso/dsm/v2/applications/{application_id}/authorizations Create Authorizations
AuthorizationManagementApi DeleteAuthorization Delete /iso/dsm/v2/applications/{application_id}/authorizations/{authorization_id} Delete/Disable an Authorization for an Application
AuthorizationManagementApi GetAuthorization Get /iso/dsm/v2/applications/{application_id}/authorizations/{authorization_id} Get an Authorization from an Application
AuthorizationManagementApi ListAuthorizations Get /iso/dsm/v2/applications/{application_id}/authorizations List Authorizations
AuthorizationManagementApi UpdateAuthorization Put /iso/dsm/v2/applications/{application_id}/authorizations/{authorization_id} Update an Authorization for an Application
DefaultApi ReadData Get /iso/dsm/v2/data Get Data for Current Authorization
SecretDataManagementApi RegisterSecretCloudCredential Post /iso/dsm/v2/secrets/{secret_id}/credentials/cloud Register a Cloud Credential on a Secret
SecretDataManagementApi RegisterSecretKV Post /iso/dsm/v2/secrets/{secret_id}/kv Create a Key/Value Pair on a Secret
SecretDataManagementApi RegisterSecretPAMCredential Post /iso/dsm/v2/secrets/{secret_id}/credentials/pam Register PAM Credentials on a Secret
SecretDataManagementApi RegisterSecretSSHKey Post /iso/dsm/v2/secrets/{secret_id}/keys Register SSH Keys on a Secret
SecretDataManagementApi RemoveSecretCloudCredential Delete /iso/dsm/v2/secrets/{secret_id}/credentials/cloud/{cloud_credential_id} Remove a Cloud Credential from a Secret
SecretDataManagementApi RemoveSecretKV Delete /iso/dsm/v2/secrets/{secret_id}/kv/{key_identifier} Remove a Key/Value Pair on a Secret
SecretDataManagementApi RemoveSecretPAMCredential Delete /iso/dsm/v2/secrets/{secret_id}/credentials/pam/{pam_credential_id} Remove a PAM Credential from a Secret
SecretDataManagementApi RemoveSecretSSHKey Delete /iso/dsm/v2/secrets/{secret_id}/keys/{key_id} Remove a SSH Key from a Secret
SecretDynamicProvisioningApi GetDynamicSecret Get /iso/dsm/v2/secrets/{secret_id}/dynamic Generate a Random Credential on a Secret
SecretManagementApi CreateSecrets Post /iso/dsm/v2/secrets Create Secret
SecretManagementApi DeleteSecret Delete /iso/dsm/v2/secrets/{secret_id} Delete/Disable a Secret
SecretManagementApi ListSecrets Get /iso/dsm/v2/secrets List Secrets
SecretManagementApi ReadSecret Get /iso/dsm/v2/secrets/{secret_id} Get a Secret
SecretManagementApi UpdateSecret Put /iso/dsm/v2/secrets/{secret_id} Update a Secret
VariableManagementApi CreateVariables Post /iso/dsm/v2/variables Register Environment Variables

Documentation For Models

Documentation For Authorization

oauth2

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes: N/A

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

egoncalves@senhasegura.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages