Skip to content
This repository was archived by the owner on Jul 26, 2020. It is now read-only.

minsql rest api returns "unauthorized" #131

Open
tommyalatalo opened this issue Aug 27, 2019 · 0 comments
Open

minsql rest api returns "unauthorized" #131

tommyalatalo opened this issue Aug 27, 2019 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@tommyalatalo
Copy link

tommyalatalo commented Aug 27, 2019

Following along with the minsql repo documentation and the examples, I fail to create a datastore after setting minsql up with a metabucket.

The below command points to some playground bucket, but the response is "401: Unauthorized"

curl -X POST \
  http://127.0.0.1:9999/api/datastores \
  -H 'Content-Type: application/json' \
  -d '{
  "bucket" : "play-minsql",
  "endpoint" : "https://play.minio.io:9000",
  "prefix" : "",
  "name" : "minioplay",
  "access_key" : "Q3AM3UQ867SPQQA43P2F",
  "secret_key" : "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
}'

Trying to point the request to my local minio instance like below yields the same unauthorized response:

curl -X POST \
  http://127.0.0.1:9999/api/v1/datastores \
  -H 'Content-Type: application/json' \
  -d '{
  "bucket" : "minsql-meta",
  "endpoint" : "https://localhost:9000",
  "prefix" : "",
  "name" : "miniotest",
  "access_key" : "minio",
  "secret_key" : "minio123"
}'

My guess was that I needed to get a token first (in contrary to the order in which the numbered list of the guide is proposing), so I tried to POST to /api/tokens/ as below, but still only get unauthorized response. Tried replacing "abcde..." with "minio" and "minio123" from the docs, but no difference.

curl -X POST \
  http://127.0.0.1:9999/api/tokens \
  -H 'Content-Type: application/json' \
  -d '{
  "access_key" : "abcdefghijklmnop",
  "secret_key" : "abcdefghijklmnopabcdefghijklmnop",
  "description" : "test",
  "is_admin" : true,
  "enabled" : false
}'
@kannappanr kannappanr added this to the First Release milestone Aug 27, 2019
@kannappanr kannappanr added the bug Something isn't working label Aug 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants