0

I'm trying to import a private Deno repo from gitlab into another Deno repo.

I run the command: deno install "https://gitlab.com/username/my_awesome_project"

But I got the error: error: Import 'https://gitlab.com/users/sign_in' failed: 503 Service Unavailable

I don't know how to handle the authentication of my gitlab into deno.

Thanks.

  • `deno download` is not a valid Deno command. What are you trying to do? Why don't you clone the repository, and run `deno run index.js` – Marcos Casagrande Jul 22 '20 at 15:21
  • Sorry, my mistake, i mean ```deno install``` – Cesar Candotti Jul 22 '20 at 15:30
  • English: I create a private repository with a functionality that is useful in another projects, now I'm trying to import this functionality in a new repo. But I have authentication problems. Spanish: Cree un repositorio con cierta funcionalidad que es para reutilizar en varios otros projectos, ahora estoy intentando importar esa funcionalidad a un nuevo projecto, pero el repositorio origen es privado y cuando hago la instalación del repo me lanza el error que figura arriba y todo indica que es por que no puede authenticarse, pero no se como hacerlo. – Cesar Candotti Jul 22 '20 at 15:46

2 Answers2

0

Deno version 1.8.0 has released support for adding an auth token for use when fetching modules.

To do this the Deno CLI will look for an environment variable named DENO_AUTH_TOKENS to determine what authentication tokens it should consider using when requesting remote modules. The value of the environment variable is in the format of a n number of tokens delimited by a semi-colon (;) where each token is in the format of {token}@{hostname[:port]}.

https://deno.land/posts/v1.8#auth-token-support-for-fetching-modules

Paul Thompson
  • 1,071
  • 1
  • 8
  • 6
0

GitLab doesn't allow you to access raw files via Auth Token. This was considered, then forgotten and now declined because of security concerns.

However they allow you to do the almost exact thing via their API. https://docs.gitlab.com/ee/api/repository_files.html#get-raw-file-from-repository

I tried this, and it works in the lsp, but deno cache fails with "unknown media type". I also don't know how imports would be handled inside the file you just downloaded, as the API URL is very different from a file/raw URL.

Example: "https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fmodels%2Fkey%2Erb/raw?ref=master"