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

Thoughts on supporting authorization headers when fetching dependencies #973

Closed
reggi opened this issue Oct 12, 2018 · 6 comments
Closed

Comments

@reggi
Copy link

reggi commented Oct 12, 2018

I've been thinking about how to maintain private files on a server and allowing deno to pull in those files.

Are there any thoughts on supporting basic auth or allowing deno to send any kind of auth header token?

@reggi
Copy link
Author

reggi commented Oct 12, 2018

Here's also an idea:

import { env } from "deno";

const auth = env()["AUTH"]

import(`https://pkg.example.com/lodash@4.17.11/index.js?auth=${auth}`).then(m => {
    console.log(m)
})

@davidnorthetal
Copy link

@reggi I tried using something like your example but it wouldn't work, I don't think import works at runtime at all? - so we can't construct URLs at runtime

I take your idea was not intended as a working example

@davidnorthetal
Copy link

I wonder if like authentication (or mere string replacements) for URL imports ought to be supported by deno itself, or if deno expects users to build proxy-servers instead in order to achieve this.

It seems to me the former is preferred, enabling a way (like a .denorc or via ENV vars or whatever) to configure deno in a way so that it can deal with various http authentication schemes?

@davidnorthetal
Copy link

davidnorthetal commented May 31, 2019

this might relate to #1921 which might enable people to authenticate with tokens passed as URL params?

@ry
Copy link
Member

ry commented Feb 24, 2020

Auth can be done using the --cert flag now which was added in 2e7d449. Although that doesn't add auth headers, I think in principle it solves this issue. Please open a new issue if the actual AUTH header (or others) is needed.

@ry ry closed this as completed Feb 24, 2020
@brandonkal
Copy link
Contributor

As far as I can tell, --cert adds an untrusted RootCA but doesn't help with presenting a client certificate to the private server for mTLS.

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

No branches or pull requests

4 participants