Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass optional orgToken configuration variable #8

Open
ndowmon opened this issue May 13, 2021 · 1 comment
Open

Pass optional orgToken configuration variable #8

ndowmon opened this issue May 13, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@ndowmon
Copy link
Contributor

ndowmon commented May 13, 2021

In Cobalt, API tokens can be valid for multiple organizations. Currently this integration naively assumes that the first organization is the one that users mean to ingest.

https://github.com/JupiterOne/graph-cobalt/blob/master/src/client.ts#L99

  public async getAccount(
    iteratee: ResourceIteratee<CobaltOrg>,
  ): Promise<void> {
    const orgs: CobaltOrg[] = await this.contactAPI(
      'https://api.cobalt.io/orgs',
    );
    await iteratee(orgs[0]);
  }

Instead, when users want to ingest a single organization, they should be able to pass an optional orgToken that they can use to fetch a specific organization.

If the org token is not present, we could either a) ingest just the first organization from https://api.cobalt.io/orgs, or b) ingest all organizations from https://api.cobalt.io/orgs. In the ideal case, each Cobalt organization is associated with a single JupiterOne integration instance.

@ndowmon ndowmon added the enhancement New feature or request label May 13, 2021
@nktrk
Copy link

nktrk commented May 13, 2021

Looks good @ndowmon - if the user supplies the Org Token in the UI, that's what should be passed in this header

https://github.com/JupiterOne/graph-cobalt/blob/master/src/client.ts#L80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants