erlef / rebar3_hex

Rebar3 Hex library
Apache License 2.0
101 stars 49 forks source link

Add "hex key add <keyname>" command #39

Closed waisbrot closed 8 years ago

waisbrot commented 8 years ago

I'm interested in creating additional Hex keys on my account so I can think about automated release publication (e.g. Travis' deployment functionality). Adding the command to the Rebar plugin seems like a nice way to go, although I ended up refactoring more than I'd intended. I can scale things back if I went too far.

The add command adds a new API key to the user's Hex account. The key is displayed to the user, but not stored anywhere.

I tried to put the key-adding code into rebar3_hex_key and the user-login code into rebar3_hex_user so now those two call each other a bit.

tsloughter commented 8 years ago

Is this a supported hex thing? I don't see it in the elixir client?

ericmj commented 8 years ago

We call it hex.user auth in mix. https://hex.pm/docs/tasks#hex_user

waisbrot commented 8 years ago

I think rebar3 hex user auth is the equivalent of mix hex.user auth.

This makes the same API call as both of those commands, but for a different purpose. Instead of storing the token in your local config (replacing any previous key), this simply prints the token without changing your local config.

My intent is to use it like https://github.com/settings/tokens and other similar setups. I want to create a Hex token that's just used for CI deployment. Maybe one token per project.

ericmj commented 8 years ago

In that case maybe it should be called gen or generate? add makes it sound like it's added to the system.

waisbrot commented 8 years ago

Sure, I'm happy with any name. Looking at this again, though, I wonder if this feature shouldn't be on the Hex.pm website and not the tool. However, I'm unlikely to make a PR for that.

ericmj commented 8 years ago

We don't have any features on the website that requires you to log in, it's essentially read only. We are unlikely to add any features like that in the near future.

waisbrot commented 8 years ago

I haven't wanted this feature since that one time, so I'm going to close this.