Giter VIP home page Giter VIP logo

azurex's People

Contributors

alexblackie avatar cblavier avatar creighton-medley avatar jakobht avatar jeremyowensboggs avatar kaaboaye avatar noaccos avatar pwcsquared avatar shahnerodgers avatar stilist avatar suranyami avatar tofran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

azurex's Issues

Help with shared key

Hey, thanks for your library ๐Ÿ™

I'm a beginner with the Azure ecosystem, I'm more used to Amazon Web Services.

It looks like Azurex.Authorization.SharedKey is somewhat similar to AWS pre-signed URLS: can I use it to authorize a user to upload just one blob in a container?

Do you have any code samples regarding this feature?

Remove timex dependency

We currently use timex to format dates as the support in elixir 1.9 wasn't good enough.

We now only support to elixir 1.11 as that is the oldest maintained version, so we should remove the timex dependency.

Timeout errors on ~10MB blobs

Issue copied from PotionalDev

First of all thanks a lot for this library!

I'm trying to put a blob which is around 10mb big. I configured at then I run the code:

# Make a blob of 16mb
blob = for x <- 1..(1024*1024), into: <<>> do <<Enum.random(0..255)>> end
blob = Enum.reduce(1..14, blob, fn (_, x) -> x <> x end)

# Create it 
Azurex.Blob.put_blob("blob", blob, "application/octet-stream")

This returns:

{:error, %HTTPoison.Error{id: nil, reason: :timeout}}

Interestingly:

  1. The blob is created, and when I download it, it is the blob I uploaded.

  2. This only happens for "bigger" binaries if the binary is e.g. 1kb the return is as expected.

I understand that the error is just propagated from HTTPoison, but I thought you might have some insights?

Support for additional authorization types

Currently, there is only shared key support. We also need support for SAS tokens and Managed Identities. What do you think that should look like?

  1. Do we want to handle it all in config, so the call signatures stay the same?
  2. add support for auth type in options?
  3. a use Azurex, <options> approach?
  4. other?

Thank You

Config as an interchangable value

I need to work with multiple Azure blob storage providers, some provided by the user at runtime. Looking at this package, it seems we default out to an environment configuration. That won't work for what I need - I need to either set the config, reset it, or pass it in as an option.

What would you prefer we do to handle this? I'd rather make a PR and build this functionality for you than fork it and do it in a vacuum.

AuthenticationFailed - "The Date header in the request is incorrect."

Hi

I have it working before like few weeks before and now I had this AuthenticationFailed for all requests.

to re-produce:

mix new my_app

and in mix.exs

  defp deps do
    [
      {:azurex, "~> 0.1.2"}
    ]
  end

and in config/config.exs

config :azurex, Azurex.Blob.Config,
  storage_account_name: System.get_env("AZURE_STORAGE_ACCOUNT"),
  storage_account_key: System.get_env("AZURE_STORAGE_ACCESS_KEY")

and run the code

Azurex.Blob.list_containers 

and I got

{:error,
 %HTTPoison.Response{
   body: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:e5a8dd0f-e01e-000c-17f1-3fd423000000\nTime:2021-05-03T07:57:39.5168256Z</Message><AuthenticationErrorDetail>The Date header in the request is incorrect.</AuthenticationErrorDetail></Error>",
   headers: [
     {"Content-Length", "419"},
     {"Content-Type", "application/xml"},
     {"Server", "Microsoft-HTTPAPI/2.0"},
     {"x-ms-request-id", "e5a8dd0f-e01e-000c-17f1-3fd423000000"},
     {"x-ms-error-code", "AuthenticationFailed"},
     {"Date", "Mon, 03 May 2021 07:57:38 GMT"}
   ],
   request: %HTTPoison.Request{
     body: "",
     headers: [
       {"authorization",
        "SharedKey xxxxxstorage:4nHSO+J19veoXUZRAXIpRbKbVQV2rS2+0wlhACky35Y="},
       {"x-ms-version", "2019-12-12"},
       {"x-ms-date", "Mon, 03 May 2021 07:57:38 Etc/UTC"}
     ],
     method: :get,
     options: [],
     params: %{},
     url: "https://xxxxxstorage.blob.core.windows.net/?comp=list"
   },
   request_url: "https://xxxxxstorage.blob.core.windows.net/?comp=list",
   status_code: 403
 }}

I suspected it's related to Timex as it did work for me before.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.