question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] Support auth credentials per scope

See original GitHub issue
  • I’d be willing to implement this feature
  • This feature can already be implemented through a plugin

I have two different packages on github and two separate accounts to access each one. So:

  • Account1 has access to package @scope1/package1
  • Account2 has access to package @scope2/package2

Both packages are hosted on the same package registry, so i need a way to configure different auth methods per package scope.

Would be nice if yarn would support specifying auth methods per package scope:

npmScopes:
    my-company:
        npmRegistryServer:
            //registry.yarnpkg.com:
                npmAuthIdent: "username1:password1"
                npmAuthToken: "ffffffff-ffff-ffff-ffff-fffffffffff1"
    my-company2:
        npmRegistryServer:
            //registry.yarnpkg.com:
                npmAuthIdent: "username2:password2"
                npmAuthToken: "ffffffff-ffff-ffff-ffff-fffffffffff2"

I don’t really know why it wasn’t implemented already, but it may be very difficult to implement. Also, this feature may degrade performance a lot.

I’ve tried to look into docs and on the internet, but it looks like doing this is not possible right now. Also, I’ve tried setting up npm to do this, but failed. Looks like hooks doesn’t provide a way to do it yet. But i may be wrong. Sadly, documentation on hook is scarce, but names for available hooks doesn’t look like they will allow implementing this as a plugin.

Additional context

Maybe I just wasn’t lucky and haven’t asked right questions and there is an easy config option to do it. But even if it is, it would be nice to see more clear example in documentation for this case.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
arznaarcommented, Mar 12, 2020

Wow! Thanks!

0reactions
arcaniscommented, Mar 3, 2020

No worry! Up for grab, then 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authentication for working with online feature stores
Follow these steps: Create two secret scopes that contain credentials for the online store: one for read-only access (shown here as <read_scope> ) ......
Read more >
Scopes - Auth0
When an app requests permission to access a resource through an authorization server , it uses the scope parameter to specify what access...
Read more >
Security and authentication | Documentation
Application credentials: grant a short-lived token, generated via OAuth 2.0, ... To learn how to format URL requests to each service, see Location...
Read more >
Managing User Credentials - Oracle Help Center
Each OAuth 2.0 client credential can have up to 10 scopes. Obtaining an OAuth 2.0 Access Token. To obtain the token, use your...
Read more >
Create access credentials | Google Workspace
Credential types · API key credentials · OAuth client ID credentials · Service account credentials.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found