Skip to content
This repository was archived by the owner on Aug 14, 2020. It is now read-only.
This repository was archived by the owner on Aug 14, 2020. It is now read-only.

spec: support HTTP headers for discovery #7

Open

Description

@philips

From @bacongobbler on December 4, 2014 17:36

I was sifting through the app-container spec on image discovery when I stumbled across this:

If simple discovery fails, then we use HTTPS+HTML meta tags to resolve an app name to a downloadable URL.

This works for the general use case, but some URLs may not have a content type of text/html e.g. in the case of an API.

For example, if I had a SaaS product and I wanted to have a discoverable URL to our API's ACI, I'd like a URL like https://example.com/api. The top-level domain (https://example.com/) would be our landing page (implying text/html), but https://example.com/api may be where our SaaS's API begins (in this case, application/json or some equivalent).

Would it be possible to extend the image discovery to use HTTP headers (HTTP_X_AC_DISCOVERY?) in the case that the content-type is not text/html? Is there a way to work around this, or would a PR for this type of extension be appreciated? :)

Copied from original issue: rkt/rkt#210

Activity

  1. philips commented on Dec 9, 2014

    @philips
    ContributorAuthor

    Adding a section to the spec saying that a header might be returned too is fine with me.

    Ac-Discovery: {prefix} {template}
    

    Aside: the X- prefix on HTTP headers has been deprecated: https://tools.ietf.org/html/rfc6648

  2. philips commented on Dec 9, 2014

    @philips
    ContributorAuthor

    @bacongobbler Would you be willing to spec this out and add it to the app-container/discovery package?

  3. philips commented on Dec 9, 2014

    @philips
    ContributorAuthor

    From @bacongobbler on December 5, 2014 18:13

    certainly!

  4. philips commented on Dec 9, 2014

    @philips
    ContributorAuthor

    From @jonboulle on December 5, 2014 18:37

    @bacongobbler please make sure to discuss the precedence/behaviour when both tags and headers are available, too :-)

  5. philips commented on Dec 9, 2014

    @philips
    ContributorAuthor

    From @bacongobbler on December 5, 2014 18:40

    of course. I'll whip up a PR to propose the change to the spec, which then you guys can all criticize before I start working on a solution.

  6. philips commented on Dec 9, 2014

    @philips
    ContributorAuthor

    From @blalor on December 5, 2014 19:8

    I feel like there should be a DNS component to this, as well. Perhaps a TXT record?

  7. philips commented on Dec 9, 2014

    @philips
    ContributorAuthor

    From @geekgonecrazy on December 8, 2014 14:59

    I second @blalor suggestion. While a meta tag is easy enough to add. It'd be easier to use an api to change a TXT record.

  8. aw commented on Jan 25, 2015

    @aw

    Hi,

    I'm not sure if using a custom HTTP header is a good idea since the HTTP Caching RFC does not require caches to store non-standard headers.

    If a cache chooses to ignore the Ac-Discovery header, then this discovery feature would not work for clients relying on the cache to retrieve the container image.

    Perhaps I can recommend the use of Content-Location, although it can only contain an absolute or partial URI (template url?). Another header would likely be needed for the prefix portion, such as Content-Type or other..

  9. changed the title [-]appc: support HTTP headers for discovery[/-] [+]spec: support HTTP headers for discovery[/+] on Feb 12, 2015
  10. modified the milestone: v2.0.0+ on Jun 10, 2015
  11. added a commit that references this issue on May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions