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.

Storage using private by default

See original GitHub issue

Describe the bug It seems that since #2898 was merged, the default storage level is now private. I think that the issue is not making the change on a copy, but directly on the configuration coming from StorageClass (see “Addition context” for details).

To Reproduce Steps to reproduce the behavior:

  1. Configure Amplify with storage enabled
  2. Get or store something with the Storage object.

Expected behavior With no special configuration, public level should be used (unless Storage.vault is used).

Actual behavior The private level is used.

Desktop (please complete the following information):

  • OS: Linux
  • Browser Chrome
  • Version 1.1.26 (Storage object is gotten through the Amplify-Angular service, version 2.1.12 but I don’t think that’s really related)

Additional context The relevant code seems to be here (from packages/storage/src/index.ts)

        logger.debug('storage configure called');
        const vaultConfig = old_configure.call(_instance, options);

        // set level private for each provider for the vault
        Object.keys(vaultConfig).forEach((providerName) => {
            if (typeof vaultConfig[providerName] !== 'string') {
                vaultConfig[providerName] = { ...vaultConfig[providerName], level: "private" };
            }
        });
        logger.debug('storage vault configure called');
        _instance.vault.configure(vaultConfig);

When stepping through , it’s pretty clear that _instance._config is updated along with the one used for the vault. AFAIK, _instance is the actual Storage object (which would explain why everything is loaded using the private level since I updated to the latest version).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
elorzafecommented, May 10, 2019

@LosD thank you so much for finding this, I could reproduce it after calling configure a second time. You can test this using the @unstable tag.

1reaction
LosDcommented, May 3, 2019

Sure, though it’ll have to wait until tomorrow. I might do better and make a testcase and a fix. Should be simple.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use private endpoints - Azure Storage | Microsoft Learn
Secure your storage account by configuring the storage firewall to block all connections on the public endpoint for the storage service.
Read more >
Using Private endpoints for Azure Storage - YouTube
In this video, demonstrated private endpoints for Azure.You can use private endpoints for your Azure Storage accounts to allow clients on a ...
Read more >
Azure Storage Account default network access is set to Allow
Restricting default network access helps to provide an additional layer of security. By default, storage accounts accept connections from clients on any network ......
Read more >
Private Service Connect | VPC - Google Cloud
Use Private Service Connect to access Google APIs. By default, if you have an application that uses a Google service, such as Cloud...
Read more >
Configure Azure storage accounts for private network ...
For instance, every storage account has a public endpoint that by default is open to clients on any network. With a private endpoint, ......
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