Skip to content

Do not store credentials in PUB_CACHE #2999

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

Closed
jonasfj opened this issue May 19, 2021 · 2 comments · Fixed by #3092
Closed

Do not store credentials in PUB_CACHE #2999

jonasfj opened this issue May 19, 2021 · 2 comments · Fixed by #3092
Assignees
Labels
type-enhancement A request for a change that isn't a bug

Comments

@jonasfj
Copy link
Member

jonasfj commented May 19, 2021

The PUB_CACHE folder is something that it makes sense to cache in CI, so storing credentials in PUB_CACHE/credentials.json might not be ideal.

On windows we prefer to use a non-roaming folder for PUB_CACHE, but configuration options such as credentials.json should probably be roaming with the user profile.

See also: dart-lang/sdk#41560

@jonasfj jonasfj added the type-enhancement A request for a change that isn't a bug label May 19, 2021
@jonasfj
Copy link
Member Author

jonasfj commented Aug 30, 2021

I'm not 100% sure about Windows and Mac OS. But it looks like what other people are doing. Not sure if it should be roaming on Windows, and it seems using XDG on Mac OS might not be so crazy.

  • On Linux (see XDG specification)
    • If $XDG_CONFIG_HOME is defined:
      • $XDG_CONFIG_HOME/dart/pub-credentials.json
      • $XDG_CONFIG_HOME/dart/pub-tokens.json
    • else
      • $HOME/.config/dart/pub-credentials.json
      • $HOME/.config/dart/pub-tokens.json
  • On Mac OS (see developer.apple.com):
    • ~/Library/Application Support/dart/pub-credentials.json
    • ~/Library/Application Support/dart/pub-tokens.json
  • On Windows: (or maybe %LOCALAPPDATA% is better)
    • %APPDATA%/dart/pub-credentials.json
    • %APPDATA%/dart/pub-tokens.json

Feedback / input is welcome from people lots of experience on these platforms.

@jonasfj
Copy link
Member Author

jonasfj commented Aug 30, 2021

Counter argument do like dartdev does and store it in ~/.dart/, as determined in:
https://github.com/dart-lang/sdk/blob/5caa4365d75a82ba2f3a702c5f426a719256f9de/pkg/dartdev/lib/src/analytics.dart#L97-L110

This is messy, and IMO we should clean it up. But until we do, perhaps it's better to just expand the mess rather than storing files in more locations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants