Skip to content

Read JetBrains Security.Auth blocks from env files #43

Closed

Description

@dataGriff

Why

JetBrains HTTP Client stores OAuth2 configurations in http-client.env.json / http-client.private.env.json under "Security": {"Auth": {"<name>": {...}}} and references them in requests as {{$auth.token("<name>")}}. A team that already has that setup should be able to run the same files with apic without translating to # @auth oauth2 by hand.

What

  • Parse Security.Auth.<name> for the selected environment: Type (OAuth2), Grant Type (Client Credentials, Password, Device Authorization, Authorization Code; Implicit is refused), Token URL, Auth URL, Client ID, Client Secret, Scope, Username, Password, Client Credentials (basic/in body), Custom Request Parameters.
  • {{$auth.token("name")}} and {{$auth.idToken("name")}} resolve by running the mapped grant through the existing OAuth2 code and cache.
  • apic env lists the auth configs by name (secrets masked); describe shows which one a request uses.
  • Unknown keys are warnings from validate, not errors.

Where

internal/env/env.go, internal/runner/vars.go (new $auth built-in), internal/auth/spec.go (mapping), internal/cli/inspect.go (env).

Docs

docs/auth.md (new "JetBrains projects" section), docs/format.md (env file section), docs/comparison.md.

Tests

Env parsing of a JetBrains-shaped file; mapping to a spec for each grant; $auth.token resolution against an httptest token endpoint; masking in env output.

Activity

  1. dataGriff commented on Sep 24, 2026

    @dataGriff
    OwnerAuthor

    Done in #115 (8d4de71). Security.Auth blocks in the env files are read, with the private file merged over the public one, and mapped onto the oauth2 grants. Implicit is refused. {{$auth.token("name")}} and {{$auth.idToken("name")}} share # @auth oauth2's token cache. apic env lists the configurations with secrets masked, describe names the one a request uses, and validate reports bad-auth-config and unknown-auth-key. See "JetBrains projects" in docs/auth.md.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions