Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

add new url to interact with deis/builder #351

Closed
aledbf opened this issue Feb 8, 2016 · 9 comments
Closed

add new url to interact with deis/builder #351

aledbf opened this issue Feb 8, 2016 · 9 comments
Assignees
Labels
Milestone

Comments

@aledbf
Copy link
Contributor

aledbf commented Feb 8, 2016

Request:

GET /v2/hooks/public_key/{ssh_public_key}

(where ssh_public_key is the SSH public key as received by the builder in Base64)

Response:

{
  "username": "john.doe",
  "fingerprint": "",
  "apps": [
    "demo"
  ]
}

Where:

  • fingerprint is the stored value in api_key
  • repositories an array that contains all the apps where the user can run git push

Return codes:

  • 200 if the key is valid with the response
  • 404 if the key is not a valid one
@aledbf aledbf added the proposal label Feb 8, 2016
@helgi
Copy link
Contributor

helgi commented Feb 8, 2016

Why this format oppose to gathering keys via app name / user name (we have those endpoints already).

I get you are wanting to do a "is valid / not valid" kind of API check but can't we do that already if we are pulling down all the keys for the given user?

@aledbf
Copy link
Contributor Author

aledbf commented Feb 8, 2016

@helgi the problem with #336 is that during the ssh auth phase there's no such thing as user/repo, just a public key (I tried to use the routes from 336 in deis/builder#148)

@helgi
Copy link
Contributor

helgi commented Feb 8, 2016

Ah I was under the impression we had access to that information at the time since we were parsing out the authorized_keys (before) and so on. That just grabbed the keys then... hmmm... well okay I will add it in today and perhaps just pull out the other hooks if needed since they seem redundant?

Were you planning on posting the public key as a base64 in the URL? Wouldn't we be better off with a POST or were you going to add the decoded string into the URL for GET?

What were you going to use repositories for? I'm inclined to rename it to apps since that's what it really is if you are just looking for the app name

@arschles
Copy link
Member

arschles commented Feb 8, 2016

Apologies, I should have been more on top of things here. @aledbf and I talked about passing the public key as base64 in the URL. I'm ok with renaming repositories to apps as you said @helgi.

Also, my vote would be to remove the other endpoints.

@helgi @aledbf thoughts?

@aledbf
Copy link
Contributor Author

aledbf commented Feb 8, 2016

perhaps just pull out the other hooks if needed since they seem redundant?

yes but can be after the merge of 148? :)

I'm inclined to rename it to apps since that's what it really is if you are just looking for the app name

👍

@helgi
Copy link
Contributor

helgi commented Feb 8, 2016

base64 in the URL feels odd but it is simple. I may change the public_key to key but we'll see, otherwise I'll implemented it a discussed and pull out the other code in a separate PR

@helgi helgi self-assigned this Feb 8, 2016
@helgi helgi added this to the v2.0-beta1 milestone Feb 8, 2016
@helgi helgi changed the title [Proposal]: add new url to interact with deis/builder add new url to interact with deis/builder Feb 8, 2016
helgi added a commit to helgi/controller that referenced this issue Feb 8, 2016
helgi added a commit to helgi/controller that referenced this issue Feb 8, 2016
@helgi
Copy link
Contributor

helgi commented Feb 8, 2016

The PR for this is ready. Have a look and see if it fits your needs

@aledbf
Copy link
Contributor Author

aledbf commented Feb 8, 2016

@helgi testing

@helgi
Copy link
Contributor

helgi commented Feb 8, 2016

If Go has it, use the urlsafe base64 encoding

helgi added a commit to helgi/controller that referenced this issue Feb 8, 2016
helgi added a commit to helgi/controller that referenced this issue Feb 8, 2016
helgi added a commit to helgi/controller that referenced this issue Feb 8, 2016
helgi added a commit to helgi/controller that referenced this issue Feb 9, 2016
helgi added a commit to helgi/controller that referenced this issue Feb 9, 2016
helgi added a commit to helgi/controller that referenced this issue Feb 9, 2016
helgi added a commit to helgi/controller that referenced this issue Feb 9, 2016
@helgi helgi closed this as completed in #352 Feb 9, 2016
@helgi helgi removed the in progress label Feb 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants