5.3.1 • Published 10 months ago

conjur v5.3.1

Weekly downloads
-
License
Apache 2.0
Repository
-
Last release
10 months ago

conjur

Conjur - JavaScript client for conjur This is an API definition for CyberArk Conjur Open Source. You can find out more at Conjur.org. This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 5.3.1
  • Package version: 5.3.1
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install conjur --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your conjur from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

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

var Conjur = require('conjur');

var defaultClient = Conjur.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'

var api = new Conjur.AuthenticationApi()
var account = "account_example"; // {String} Organization account name
var body = "body_example"; // {String} New password
var opts = {
  'xRequestId': test-id // {String} Add an ID to the request being made so it can be tracked in Conjur. If not provided the server will automatically generate one. 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.changePassword(account, body, opts, callback);

Documentation for API Endpoints

All URIs are relative to http://localhost

ClassMethodHTTP requestDescription
Conjur.AuthenticationApichangePasswordPUT /authn/{account}/passwordChanges a user’s password.
Conjur.AuthenticationApienableAuthenticatorPATCH /{authenticator}/{account}Enables or disables authenticator defined without service_id.
Conjur.AuthenticationApienableAuthenticatorInstancePATCH /{authenticator}/{service_id}/{account}Enables or disables authenticator service instances.
Conjur.AuthenticationApigetAPIKeyGET /authn/{account}/loginGets the API key of a user given the username and password via HTTP Basic Authentication.
Conjur.AuthenticationApigetAPIKeyViaLDAPGET /authn-ldap/{service_id}/{account}/loginGets the Conjur API key of a user given the LDAP username and password via HTTP Basic Authentication.
Conjur.AuthenticationApigetAccessTokenPOST /authn/{account}/{login}/authenticateGets a short-lived access token, which is required in the header of most subsequent API requests.
Conjur.AuthenticationApigetAccessTokenViaAWSPOST /authn-iam/{service_id}/{account}/{login}/authenticateGet a short-lived access token for applications running in AWS.
Conjur.AuthenticationApigetAccessTokenViaAzurePOST /authn-azure/{service_id}/{account}/{login}/authenticateGets a short-lived access token for applications running in Azure.
Conjur.AuthenticationApigetAccessTokenViaGCPPOST /authn-gcp/{account}/authenticateGets a short-lived access token for applications running in Google Cloud Platform.
Conjur.AuthenticationApigetAccessTokenViaJWTPOST /authn-jwt/{service_id}/{account}/authenticateGets a short-lived access token for applications using JSON Web Token (JWT) to access the Conjur API.
Conjur.AuthenticationApigetAccessTokenViaJWTWithIdPOST /authn-jwt/{service_id}/{account}/{id}/authenticateGets a short-lived access token for applications using JSON Web Token (JWT) to access the Conjur API. Covers the case of use of optional URL parameter \"ID\"
Conjur.AuthenticationApigetAccessTokenViaKubernetesPOST /authn-k8s/{service_id}/{account}/{login}/authenticateGets a short-lived access token for applications running in Kubernetes.
Conjur.AuthenticationApigetAccessTokenViaLDAPPOST /authn-ldap/{service_id}/{account}/{login}/authenticateGets a short-lived access token for users and hosts using their LDAP identity to access the Conjur API.
Conjur.AuthenticationApigetAccessTokenViaOIDCPOST /authn-oidc/{service_id}/{account}/authenticateGets a short-lived access token for applications using OpenID Connect (OIDC) to access the Conjur API.
Conjur.AuthenticationApik8sInjectClientCertPOST /authn-k8s/{service_id}/inject_client_certFor applications running in Kubernetes; sends Conjur a certificate signing request (CSR) and requests a client certificate injected into the application's Kubernetes pod.
Conjur.AuthenticationApirotateApiKeyPUT /authn/{account}/api_keyRotates a role's API key.
Conjur.CertificateAuthorityApisignPOST /ca/{account}/{service_id}/signGets a signed certificate from the configured Certificate Authority service.
Conjur.HostFactoryApicreateHostPOST /host_factories/hostsCreates a Host using the Host Factory.
Conjur.HostFactoryApicreateTokenPOST /host_factory_tokensCreates one or more host identity tokens.
Conjur.HostFactoryApirevokeTokenDELETE /host_factory_tokens/{token}Revokes a token, immediately disabling it.
Conjur.PoliciesApiloadPolicyPOST /policies/{account}/policy/{identifier}Adds data to the existing Conjur policy.
Conjur.PoliciesApireplacePolicyPUT /policies/{account}/policy/{identifier}Loads or replaces a Conjur policy document.
Conjur.PoliciesApiupdatePolicyPATCH /policies/{account}/policy/{identifier}Modifies an existing Conjur policy.
Conjur.PublicKeysApishowPublicKeysGET /public_keys/{account}/{kind}/{identifier}Shows all public keys for a resource.
Conjur.ResourcesApishowResourceGET /resources/{account}/{kind}/{identifier}Shows a description of a single resource.
Conjur.ResourcesApishowResourcesForAccountGET /resources/{account}Lists resources within an organization account.
Conjur.ResourcesApishowResourcesForAllAccountsGET /resourcesLists resources within an organization account.
Conjur.ResourcesApishowResourcesForKindGET /resources/{account}/{kind}Lists resources of the same kind within an organization account.
Conjur.RolesApiaddMemberToRolePOST /roles/{account}/{kind}/{identifier}Update or modify an existing role membership
Conjur.RolesApiremoveMemberFromRoleDELETE /roles/{account}/{kind}/{identifier}Deletes an existing role membership
Conjur.RolesApishowRoleGET /roles/{account}/{kind}/{identifier}Get role information
Conjur.SecretsApicreateSecretPOST /secrets/{account}/{kind}/{identifier}Creates a secret value within the specified variable.
Conjur.SecretsApigetSecretGET /secrets/{account}/{kind}/{identifier}Fetches the value of a secret from the specified Secret.
Conjur.SecretsApigetSecretsGET /secretsFetch multiple secrets
Conjur.StatusApigetAuthenticatorsGET /authenticatorsDetails about which authenticators are on the Conjur Server
Conjur.StatusApigetGCPAuthenticatorStatusGET /authn-gcp/{account}/statusDetails whether an authentication service has been configured properly
Conjur.StatusApigetServiceAuthenticatorStatusGET /{authenticator}/{service_id}/{account}/statusDetails whether an authentication service has been configured properly
Conjur.StatusApiwhoAmIGET /whoamiProvides information about the client making an API request.

Documentation for Models

Documentation for Authorization

basicAuth

  • Type: HTTP basic authentication

conjurAuth

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

conjurKubernetesMutualTls

5.3.1

10 months ago