Skip to content

Conversation

jpadrianoGo
Copy link
Contributor

Description

This PR adds CreatedBy relation to AgentToken struct.

Testing plan

  1. Generate the required environment variables for go test, TFE_ADDRESS and TFE_TOKEN
  2. Run TFE_ADDRESS="https://example" TFE_TOKEN="example" go test ./... -v -run TestAgentTokensReadCreatedBy. The new tests should pass.
  3. CreatedBy relation is read for AgentToken.
{
  "data": {
    "id": "at-***",
    "type": "authentication-tokens",
    "attributes": {
      "created-at": "2025-07-05T01:50:16.218Z",
      "last-used-at": null,
      "description": "this agent token is created by user-***",
      "token": null,
      "expired-at": null
    },
    "relationships": {
      "team": {
        "data": null
      },
      "created-by": {
        "data": {
          "id": "user-***",
          "type": "users"
        }
      }
    }
  }
}

External links

Output from tests

Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.

$ TFE_ADDRESS="https://example" TFE_TOKEN="example"go test ./... -v -run TestAgentTokensReadCreatedBy

=== RUN   TestAgentTokensReadCreatedBy
--- PASS: TestAgentTokensReadCreatedBy (3.56s)
PASS
ok      github.com/hashicorp/go-tfe     3.614s

@jpadrianoGo jpadrianoGo requested a review from a team as a code owner July 5, 2025 02:05
Copy link
Collaborator

@ctrombley ctrombley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ctrombley
Copy link
Collaborator

Superseded by #1158.

@ctrombley ctrombley closed this Jul 15, 2025
@jpadrianoGo
Copy link
Contributor Author

thank you @ctrombley

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

Successfully merging this pull request may close these issues.

2 participants