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

Missing information from lookup-self #18

Closed
Ginja opened this issue Jan 11, 2017 · 7 comments
Closed

Missing information from lookup-self #18

Ginja opened this issue Jan 11, 2017 · 7 comments
Assignees
Labels
Milestone

Comments

@Ginja
Copy link
Contributor

Ginja commented Jan 11, 2017

From my testing it appears the data returned from running await this.Client.GetCallingTokenInfoAsync(); should include the token's accessor, ttl, & creation time underneath its Data field:

What's available now:

image

What's returned via the lookup-self API:

curl --tlsv1.2 -X GET -H "X-Vault-Token:REDACTED" "https://x.x.x.x/v1/auth/token/lookup-self"
{
  "request_id": "REDACTED",
  "lease_id": "",
  "renewable": false,
  "lease_duration": 0,
  "data": {
    "accessor": "REDACTED",
    "creation_time": 1484093665,
    "creation_ttl": 3600,
    "display_name": "approle",
    "explicit_max_ttl": 0,
    "id": "REDACTED",
    "meta": {
      "key": "value"
    },
    "num_uses": 0,
    "orphan": true,
    "path": "auth/approle/login",
    "policies": [
      "default"
    ],
    "renewable": true,
    "ttl": 3655
  },
  "wrap_info": null,
  "warnings": null,
  "auth": null
}
@rajanadar rajanadar self-assigned this Jan 11, 2017
@rajanadar rajanadar added the bug label Jan 11, 2017
@rajanadar rajanadar added this to the 0.6.4 milestone Jan 11, 2017
rajanadar added a commit that referenced this issue Jan 11, 2017
@rajanadar
Copy link
Owner

thanks @Ginja for crisply calling out the expected vs. actual.
fixed the bug.

was thrown off by Vault's documentation site showing the following stale format.
https://www.vaultproject.io/docs/auth/token.html

image

have sent a PR for the Vault team as well.
hashicorp/vault#2258

@Ginja
Copy link
Contributor Author

Ginja commented Jan 11, 2017

Thanks for such a quick fix, @rajanadar!

I haven't tested anything yet, but just looking at your changes (note, I am rusty with C#). Would it still return the Token ID underneath the Data field? I don't see the field in either of the CallingTokenInfo.cs or TokenAccessorInfo.cs classes.

@rajanadar
Copy link
Owner

The TokenAccessorInfo itself has a base class TokenInfo, which has the Id field along with some others.

@Ginja
Copy link
Contributor Author

Ginja commented Jan 11, 2017

Right! Missed that.

Thanks again.

@rajanadar
Copy link
Owner

@Ginja VaultSharp 0.6.4 is now live. please go get it to see this fix!

@Ginja
Copy link
Contributor Author

Ginja commented Jan 18, 2017

Sorry I should have posted back. Once you merged it, I forked your repo, built the latest solution, & manually referenced it in my project. Works beautifully! Thank you for the quick response.

@rajanadar
Copy link
Owner

very cool.

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

No branches or pull requests

2 participants