conjur

5.3.1 • Public • Published

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

Class Method HTTP request Description
Conjur.AuthenticationApi changePassword PUT /authn/{account}/password Changes a user’s password.
Conjur.AuthenticationApi enableAuthenticator PATCH /{authenticator}/{account} Enables or disables authenticator defined without service_id.
Conjur.AuthenticationApi enableAuthenticatorInstance PATCH /{authenticator}/{service_id}/{account} Enables or disables authenticator service instances.
Conjur.AuthenticationApi getAPIKey GET /authn/{account}/login Gets the API key of a user given the username and password via HTTP Basic Authentication.
Conjur.AuthenticationApi getAPIKeyViaLDAP GET /authn-ldap/{service_id}/{account}/login Gets the Conjur API key of a user given the LDAP username and password via HTTP Basic Authentication.
Conjur.AuthenticationApi getAccessToken POST /authn/{account}/{login}/authenticate Gets a short-lived access token, which is required in the header of most subsequent API requests.
Conjur.AuthenticationApi getAccessTokenViaAWS POST /authn-iam/{service_id}/{account}/{login}/authenticate Get a short-lived access token for applications running in AWS.
Conjur.AuthenticationApi getAccessTokenViaAzure POST /authn-azure/{service_id}/{account}/{login}/authenticate Gets a short-lived access token for applications running in Azure.
Conjur.AuthenticationApi getAccessTokenViaGCP POST /authn-gcp/{account}/authenticate Gets a short-lived access token for applications running in Google Cloud Platform.
Conjur.AuthenticationApi getAccessTokenViaJWT POST /authn-jwt/{service_id}/{account}/authenticate Gets a short-lived access token for applications using JSON Web Token (JWT) to access the Conjur API.
Conjur.AuthenticationApi getAccessTokenViaJWTWithId POST /authn-jwt/{service_id}/{account}/{id}/authenticate Gets 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 &quot;ID&quot;
Conjur.AuthenticationApi getAccessTokenViaKubernetes POST /authn-k8s/{service_id}/{account}/{login}/authenticate Gets a short-lived access token for applications running in Kubernetes.
Conjur.AuthenticationApi getAccessTokenViaLDAP POST /authn-ldap/{service_id}/{account}/{login}/authenticate Gets a short-lived access token for users and hosts using their LDAP identity to access the Conjur API.
Conjur.AuthenticationApi getAccessTokenViaOIDC POST /authn-oidc/{service_id}/{account}/authenticate Gets a short-lived access token for applications using OpenID Connect (OIDC) to access the Conjur API.
Conjur.AuthenticationApi k8sInjectClientCert POST /authn-k8s/{service_id}/inject_client_cert For applications running in Kubernetes; sends Conjur a certificate signing request (CSR) and requests a client certificate injected into the application's Kubernetes pod.
Conjur.AuthenticationApi rotateApiKey PUT /authn/{account}/api_key Rotates a role's API key.
Conjur.CertificateAuthorityApi sign POST /ca/{account}/{service_id}/sign Gets a signed certificate from the configured Certificate Authority service.
Conjur.HostFactoryApi createHost POST /host_factories/hosts Creates a Host using the Host Factory.
Conjur.HostFactoryApi createToken POST /host_factory_tokens Creates one or more host identity tokens.
Conjur.HostFactoryApi revokeToken DELETE /host_factory_tokens/{token} Revokes a token, immediately disabling it.
Conjur.PoliciesApi loadPolicy POST /policies/{account}/policy/{identifier} Adds data to the existing Conjur policy.
Conjur.PoliciesApi replacePolicy PUT /policies/{account}/policy/{identifier} Loads or replaces a Conjur policy document.
Conjur.PoliciesApi updatePolicy PATCH /policies/{account}/policy/{identifier} Modifies an existing Conjur policy.
Conjur.PublicKeysApi showPublicKeys GET /public_keys/{account}/{kind}/{identifier} Shows all public keys for a resource.
Conjur.ResourcesApi showResource GET /resources/{account}/{kind}/{identifier} Shows a description of a single resource.
Conjur.ResourcesApi showResourcesForAccount GET /resources/{account} Lists resources within an organization account.
Conjur.ResourcesApi showResourcesForAllAccounts GET /resources Lists resources within an organization account.
Conjur.ResourcesApi showResourcesForKind GET /resources/{account}/{kind} Lists resources of the same kind within an organization account.
Conjur.RolesApi addMemberToRole POST /roles/{account}/{kind}/{identifier} Update or modify an existing role membership
Conjur.RolesApi removeMemberFromRole DELETE /roles/{account}/{kind}/{identifier} Deletes an existing role membership
Conjur.RolesApi showRole GET /roles/{account}/{kind}/{identifier} Get role information
Conjur.SecretsApi createSecret POST /secrets/{account}/{kind}/{identifier} Creates a secret value within the specified variable.
Conjur.SecretsApi getSecret GET /secrets/{account}/{kind}/{identifier} Fetches the value of a secret from the specified Secret.
Conjur.SecretsApi getSecrets GET /secrets Fetch multiple secrets
Conjur.StatusApi getAuthenticators GET /authenticators Details about which authenticators are on the Conjur Server
Conjur.StatusApi getGCPAuthenticatorStatus GET /authn-gcp/{account}/status Details whether an authentication service has been configured properly
Conjur.StatusApi getServiceAuthenticatorStatus GET /{authenticator}/{service_id}/{account}/status Details whether an authentication service has been configured properly
Conjur.StatusApi whoAmI GET /whoami Provides 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

Readme

Keywords

none

Package Sidebar

Install

npm i conjur

Weekly Downloads

2

Version

5.3.1

License

Apache 2.0

Unpacked Size

396 kB

Total Files

32

Last publish

Collaborators

  • ecoen66