Public Member Functions | |
Remote (BNRemote *remote) | |
std::string | GetUniqueId () |
std::string | GetName () |
std::string | GetAddress () |
bool | HasLoadedMetadata () |
bool | IsConnected () |
std::string | GetUsername () |
std::string | GetToken () |
int | GetServerVersion () |
std::string | GetServerBuildId () |
std::vector< std::pair< std::string, std::string > > | GetAuthBackends () |
bool | HasPulledProjects () |
bool | HasPulledUsers () |
bool | HasPulledGroups () |
bool | IsAdmin () |
bool | IsEnterprise () |
Determine if a remote is the same as the currently connected Enterprise Server On non-Enterprise clients, this always returns false. | |
bool | LoadMetadata () |
Load remote metadata, including version, id, and auth backends. | |
std::string | RequestAuthenticationToken (const std::string &username, const std::string &password) |
Request an authentication token for a user given a username and password. | |
void | Connect (const std::string &username, const std::string &token) |
Establish a connection to the remote, using a username and token. | |
void | Disconnect () |
Disconnect from the remote. | |
std::vector< Ref< RemoteProject > > | GetProjects () |
Get all projects in the Remote. | |
Ref< RemoteProject > | GetProjectById (const std::string &id) |
Get a project in the remote by its id. | |
Ref< RemoteProject > | GetProjectByName (const std::string &name) |
Get a project in the remote by its name. | |
void | PullProjects (std::function< bool(size_t, size_t)> progress={}) |
Pull list of projects from the remote. | |
Ref< RemoteProject > | CreateProject (const std::string &name, const std::string &description) |
Create a new project on the remote (and pull it) | |
Ref< RemoteProject > | ImportLocalProject (Ref< Project > localProject, std::function< bool(size_t, size_t)> progress={}) |
Create a new project on the remote from a local project. | |
void | PushProject (Ref< RemoteProject > project, const std::vector< std::pair< std::string, std::string > > &extraFields={}) |
Push fields of a modified project to the remote. | |
void | DeleteProject (const Ref< RemoteProject > project) |
Delete a project from the remote. | |
std::vector< Ref< CollabGroup > > | GetGroups () |
Get all groups in the Project. | |
Ref< CollabGroup > | GetGroupById (uint64_t id) |
Get a group in the project by its id. | |
Ref< CollabGroup > | GetGroupByName (const std::string &name) |
Get a group in the project by its name. | |
std::vector< std::pair< uint64_t, std::string > > | SearchGroups (const std::string &prefix) |
Search groups on the remote. | |
void | PullGroups (std::function< bool(size_t, size_t)> progress={}) |
Pull list of groups from the remote. | |
Ref< CollabGroup > | CreateGroup (const std::string &name, const std::vector< std::string > &usernames) |
Create a new group on the remote (and pull it) | |
void | PushGroup (Ref< CollabGroup > group, const std::vector< std::pair< std::string, std::string > > &extraFields={}) |
Push fields of a modified group to the remote. | |
void | DeleteGroup (const Ref< CollabGroup > group) |
Delete a group from the remote. | |
std::vector< Ref< CollabUser > > | GetUsers () |
Get all users in the Remote. | |
Ref< CollabUser > | GetUserById (const std::string &id) |
Get a user in the remote by their id. | |
Ref< CollabUser > | GetUserByUsername (const std::string &username) |
Get a user in the remote by their username. | |
Ref< CollabUser > | GetCurrentUser () |
Get the currently logged-in user's CollabUser object. | |
std::vector< std::pair< std::string, std::string > > | SearchUsers (const std::string &prefix) |
Search users on the remote. | |
void | PullUsers (std::function< bool(size_t, size_t)> progress={}) |
Pull list of users from the remote. | |
Ref< CollabUser > | CreateUser (const std::string &username, const std::string &email, bool is_active, const std::string &password, const std::vector< uint64_t > &groupIds, const std::vector< uint64_t > &userPermissionIds) |
Create a new user on the remote (and pull it) | |
void | PushUser (Ref< CollabUser > user, const std::vector< std::pair< std::string, std::string > > &extraFields={}) |
Push fields of a modified user to the remote. | |
int | Request (Http::Request request, Http::Response &ret) |
Perform an arbitrary HTTP request. | |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNRemote, BNNewRemoteReference, BNFreeRemote > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNRemote * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNRemote, BNNewRemoteReference, BNFreeRemote > | |
static BNRemote * | GetObject (CoreRefCountObject *obj) |
static BNRemote * | GetObject (const CoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNRemote, BNNewRemoteReference, BNFreeRemote > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNRemote * | m_object |
Remote::Remote | ( | BNRemote * | remote | ) |
std::string Remote::GetUniqueId | ( | ) |
std::string Remote::GetName | ( | ) |
std::string Remote::GetAddress | ( | ) |
bool Remote::HasLoadedMetadata | ( | ) |
bool Remote::IsConnected | ( | ) |
std::string Remote::GetUsername | ( | ) |
std::string Remote::GetToken | ( | ) |
int Remote::GetServerVersion | ( | ) |
std::string Remote::GetServerBuildId | ( | ) |
std::vector< std::pair< std::string, std::string > > Remote::GetAuthBackends | ( | ) |
bool Remote::HasPulledProjects | ( | ) |
bool Remote::HasPulledUsers | ( | ) |
bool Remote::HasPulledGroups | ( | ) |
bool Remote::IsAdmin | ( | ) |
bool Remote::IsEnterprise | ( | ) |
Determine if a remote is the same as the currently connected Enterprise Server On non-Enterprise clients, this always returns false.
bool Remote::LoadMetadata | ( | ) |
Load remote metadata, including version, id, and auth backends.
RemoteException | If there is an error in any request, or if the remote version is not supported |
std::string Remote::RequestAuthenticationToken | ( | const std::string & | username, |
const std::string & | password ) |
Request an authentication token for a user given a username and password.
username | CollabUser's username |
password | CollabUser's password |
RemoteException | If there is an error in any request |
void Remote::Connect | ( | const std::string & | username, |
const std::string & | token ) |
Establish a connection to the remote, using a username and token.
username | CollabUser's username |
token | CollabUser's authentication token |
RemoteException | If there is an error in any request |
void Remote::Disconnect | ( | ) |
Disconnect from the remote.
std::vector< Ref< RemoteProject > > Remote::GetProjects | ( | ) |
Get all projects in the Remote.
RemoteException | if projects have not been pulled or if the remote is not connected |
Ref< RemoteProject > Remote::GetProjectById | ( | const std::string & | id | ) |
Get a project in the remote by its id.
id | Project's id |
RemoteException | If projects have not been pulled or if the remote is not connected |
Ref< RemoteProject > Remote::GetProjectByName | ( | const std::string & | name | ) |
Get a project in the remote by its name.
name | Project's name |
RemoteException | If projects have not been pulled or if the remote is not connected |
void Remote::PullProjects | ( | std::function< bool(size_t, size_t)> | progress = {} | ) |
Pull list of projects from the remote.
Necessary before calling GetProjects()
progress | Function to call on progress updates |
RemoteException | If there is an error in any request or if the remote is not connected |
Ref< RemoteProject > Remote::CreateProject | ( | const std::string & | name, |
const std::string & | description ) |
Create a new project on the remote (and pull it)
RemoteException | If there is an error in any request or if the remote is not connected |
Ref< RemoteProject > Remote::ImportLocalProject | ( | Ref< Project > | localProject, |
std::function< bool(size_t, size_t)> | progress = {} ) |
Create a new project on the remote from a local project.
localProject | The local project that should be copied to the server |
progress | Function to call on progress updates |
RemoteException | If there is an error in any request or if the remote is not connected |
void Remote::PushProject | ( | Ref< RemoteProject > | project, |
const std::vector< std::pair< std::string, std::string > > & | extraFields = {} ) |
Push fields of a modified project to the remote.
project | Updated project |
extraFields | Extra post fields for the request |
RemoteException | If there is an error in any request or if the remote is not connected |
void Remote::DeleteProject | ( | const Ref< RemoteProject > | project | ) |
Delete a project from the remote.
project | Pointer to project to delete (will invalidate pointer) |
RemoteException | If there is an error in any request or if the remote is not connected |
std::vector< Ref< CollabGroup > > Remote::GetGroups | ( | ) |
Get all groups in the Project.
RemoteException | if groups have not been pulled or if the remote is not connected |
Ref< CollabGroup > Remote::GetGroupById | ( | uint64_t | id | ) |
Get a group in the project by its id.
id | Group's id |
RemoteException | If groups have not been pulled or if the remote is not connected |
Ref< CollabGroup > Remote::GetGroupByName | ( | const std::string & | name | ) |
Get a group in the project by its name.
Will check for both name and <project id>/name
name | Group's name |
RemoteException | If groups have not been pulled or if the remote is not connected |
std::vector< std::pair< uint64_t, std::string > > Remote::SearchGroups | ( | const std::string & | prefix | ) |
Search groups on the remote.
prefix | Prefix to search for |
RemoteException | If there is an error in any request or if the remote is not connected |
void Remote::PullGroups | ( | std::function< bool(size_t, size_t)> | progress = {} | ) |
Pull list of groups from the remote.
Necessary before calling GetGroups()
progress | Function to call on progress updates |
RemoteException | If there is an error in any request or if the remote is not connected |
Ref< CollabGroup > Remote::CreateGroup | ( | const std::string & | name, |
const std::vector< std::string > & | usernames ) |
Create a new group on the remote (and pull it)
name | Group name |
RemoteException | If there is an error in any request or if the remote is not connected |
void Remote::PushGroup | ( | Ref< CollabGroup > | group, |
const std::vector< std::pair< std::string, std::string > > & | extraFields = {} ) |
Push fields of a modified group to the remote.
group | Updated group |
extraFields | Extra post fields for the request |
RemoteException | If there is an error in any request or if the remote is not connected |
void Remote::DeleteGroup | ( | const Ref< CollabGroup > | group | ) |
Delete a group from the remote.
group | Pointer to group to delete (will invalidate pointer) |
RemoteException | If there is an error in any request or if the remote is not connected |
std::vector< Ref< CollabUser > > Remote::GetUsers | ( | ) |
Get all users in the Remote.
RemoteException | if users have not been pulled or if the remote is not connected |
Ref< CollabUser > Remote::GetUserById | ( | const std::string & | id | ) |
Get a user in the remote by their id.
id | CollabUser's id |
RemoteException | If users have not been pulled or if the remote is not connected |
Ref< CollabUser > Remote::GetUserByUsername | ( | const std::string & | username | ) |
Get a user in the remote by their username.
username | CollabUser's username |
RemoteException | If users have not been pulled or if the remote is not connected |
Ref< CollabUser > Remote::GetCurrentUser | ( | ) |
Get the currently logged-in user's CollabUser object.
RemoteException | if users have not been pulled or if the remote is not connected |
std::vector< std::pair< std::string, std::string > > Remote::SearchUsers | ( | const std::string & | prefix | ) |
Search users on the remote.
prefix | Prefix to search for |
RemoteException | If there is an error in any request or if the remote is not connected |
void Remote::PullUsers | ( | std::function< bool(size_t, size_t)> | progress = {} | ) |
Pull list of users from the remote.
Necessary before calling GetUsers()
progress | Function to call on progress updates |
RemoteException | If there is an error in any request or if the remote is not connected |
Ref< CollabUser > Remote::CreateUser | ( | const std::string & | username, |
const std::string & | email, | ||
bool | is_active, | ||
const std::string & | password, | ||
const std::vector< uint64_t > & | groupIds, | ||
const std::vector< uint64_t > & | userPermissionIds ) |
Create a new user on the remote (and pull it)
name | CollabUser name |
CollabUser email | |
is_active | If the user should initially be active |
password | CollabUser password |
groupIds | List of group ids the user will be added to |
userPermissionIds | List of permission ids the user will be granted |
RemoteException | If there is an error in any request or if the remote is not connected |
void Remote::PushUser | ( | Ref< CollabUser > | user, |
const std::vector< std::pair< std::string, std::string > > & | extraFields = {} ) |
Push fields of a modified user to the remote.
user | Updated user |
extraFields | Extra post fields for the request (eg password) |
RemoteException | If there is an error in any request or if the remote is not connected |
int Remote::Request | ( | Http::Request | request, |
Http::Response & | ret ) |
Perform an arbitrary HTTP request.
An "Authorization: Token <token>" header will be added with the Remote's token for the current login session.
request | Request structure with headers and content. |
response | Response structure with body |