Corellium

Corellium

The Corellium API client.

Constructor

new Corellium(options)

Source:

Create a new Corellium client.

Example
const corellium = new Corellium({
    endpoint: 'https://app.corellium.com',
    username: 'username',
    password: 'password',
    totpToken: '123456',
});
Parameters:
Name Type Description
options Object
Properties
Name Type Description
endpoint string

Endpoint URL

username string

Login username

password string

Login password

totpToken string

Login TOTP (Timebased One Time Password)

Methods

(async) addProjectKey(project, key, kind, labelopt) → {string}

Source:

Adds key to the project

Example
let project = insatnce.getProjectNamed('TestProject');
instance.addProjectKey(project.id, key, 'ssh', 'SSH Key');
Parameters:
Name Type Attributes Default Description
project string

project ID

key string

public key

kind string ssh

key type ('ssh'/'abd')

label string <optional>
null

key label

Returns:

key ID

Type
string

(async) createProject(name, color, settingsopt) → {Promise.<Project>}

Source:

Creates a Project with the given name Color and ProjectSettings.

Example
corellium.createProject("TestProject");
Parameters:
Name Type Attributes Default Description
name string

project name

color integer 1

color

settings Object <optional>

project settings

Properties
Name Type Description
version integer
internet-access boolean
Returns:
Type
Promise.<Project>

(async) createRole(project, grantee, type)

Source:

Creates a Role for a Project and a Team or User.

Example
instance.createRole(project.id, grantee, 'user');
Parameters:
Name Type Default Description
project string

project ID

grantee User | Team

must be an instance of User or Team

type string user

user ID

(async) createUser() → {Promise.<User>}

Source:

Creates a new user in the domain.

This function is only available to domain administrators.

Example
let user = await instance.createUser("login", "User Name", "user@email.com", "password");
Returns:
Type
Promise.<User>

(async) deleteProjectKey(project, keyId)

Source:

Adds key to the project

Example
let project = insatnce.getProjectNamed('TestProject');
instance.deleteProjectKey(project.id, 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Parameters:
Name Type Description
project string

project ID

keyId string

key ID

(async) destroyRole(role)

Source:

Destroys a Role

Example
instance.destroyRole(role);
Parameters:
Name Type Description
role Role

role object

(async) destroyUser(id)

Source:

Destroys a user in the domain.

This function is only available to domain administrators.

Example
instance.destroyUser('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Parameters:
Name Type Description
id string

user ID

(async) getProject(projectId) → {Promise.<Project>}

Source:

Returns the Project with the given ID.

Example
let project = await corellium.getProject('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Parameters:
Name Type Description
projectId string

project ID

Returns:
Type
Promise.<Project>

getTeam() → {Promise.<Team>}

Source:

Given a team id, returns the Team.

This function is only available to domain and project administrators.

Example
let team = await instance.getTeam('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Returns:
Type
Promise.<Team>

(async) getTeamsAndUsers() → {Promise.<{teams: Map.<string, Team>, users: Map.<string, User>}>}

Source:

Returns teams and users belonging to the domain.

This function is only available to administrators.

Example
let teamsAndUsers = await corellium.getTeamsAndUsers();
Returns:
Type
Promise.<{teams: Map.<string, Team>, users: Map.<string, User>}>

(async) getToken() → {string}

Source:

Returns refreshed authentication token

Example
let token = await corellium.getToken()
Returns:

token

Type
string

getUser() → {Promise.<User>}

Source:

Given a user id, returns the User.

This function is only available to domain and project administrators.

Example
let user = await instance.getUser('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Returns:
Type
Promise.<User>

(async) login()

Source:

Logs into the Corellium API and obtains an authentication token. Does nothing if the current authentication token is up to date.

Calling this method is not required, as calling any other method that needs an authentication token will do the same thing.

Example
await corellium.login();

(async) projectKeys(project) → {Array.<ProjectKey>}

Source:

Returns all keys for the project

Example
let keys = instance.projectKeys(project.id);
for(let key of keys)
  console.log(key);
Parameters:
Name Type Description
project string

project ID

Returns:
Type
Array.<ProjectKey>

(async) projectNamed(name) → {Promise.<Project>}

Source:

Returns the Project with the given name. If the project doesn't exist, returns undefined.

Example
let project = await corellium.projectNamed('Default Project');
Parameters:
Name Type Description
name string

project name to match

Returns:
Type
Promise.<Project>

(async) projects() → {Array.<Project>}

Source:

Returns an array of Projects that this client is allowed to access.

Example
let projects = await corellium.projects();
let project = projects.find(project => project.name === "Demo Project");
Returns:
Type
Array.<Project>

(async) roles() → {Promise.<Map.<string, Array.<Role>>>}

Source:

Returns Roles belonging to the domain.

This function is only available to domain and project administrators.

Example
let roles = await corellium.roles();
Returns:
Type
Promise.<Map.<string, Array.<Role>>>

(async) supported() → {Array.<SupportedDevice>}

Source:

Returns supported device list

Example
let supported = await corellium.supported();
Returns:
Type
Array.<SupportedDevice>

(async) teams() → {Promise.<Map.<string, Team>>}

Source:

Returns Teams belonging to the domain.

This function is only available to domain and project administrators.

Example
let teams = await corellium.teams();
Returns:
Type
Promise.<Map.<string, Team>>

(async) users() → {Promise.<Map.<string, User>>}

Source:

Returns Users belonging to the domain.

This function is only available to domain and project administrators.

Example
let users = await corellium.users();
Returns:
Type
Promise.<Map.<string, User>>