Skip to content

Commit

Permalink
Fixed api key token name
Browse files Browse the repository at this point in the history
  • Loading branch information
bkryza committed Oct 24, 2016
1 parent 5abcaf1 commit 6b4fb2c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ docker run --rm -e "CHOWNUID=${UID}" -v `pwd`:/swagger -t docker.onedata.org/swa
#
# Build Bash client
#
docker run --rm -e "CHOWNUID=${UID}" -v `pwd`:/swagger -t docker.onedata.org/bash-swagger-codegen:0.3.5 generate -i ./swagger.json -l bash -o ./generated/bash -c bash-config.json
docker run --rm -e "CHOWNUID=${UID}" -v `pwd`:/swagger -t docker.onedata.org/bash-swagger-codegen:0.3.6 generate -i ./swagger.json -l bash -o ./generated/bash -c bash-config.json
2 changes: 1 addition & 1 deletion index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tags:
securityDefinitions:
api_key:
type: apiKey
name: X-Auth-Key
name: X-Auth-Token
in: header
basic:
type: basic
6 changes: 3 additions & 3 deletions info/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ description: |
Currently this is supported through authentication token which can be generate using the Onedata user interface.
The token must be added to the request header like this:
```
macaroon: LAKSJHDLKJAHSDKLJHASKLCBBASKLCBLHABSCBALKSBCK...
X-Auth-Token: LAKSJHDLKJAHSDKLJHASKLCBBASKLCBLHABSCBALKSBCK...
```
In addition please take into account, that depending on your account authorization rights, not all operations
Expand Down Expand Up @@ -84,13 +84,13 @@ description: |
**Create replica of file at specific storage provider**
```bash
curl -v --tlsv1.2 -H "X-Auth-Token: $TOKEN" -X POST \
"https://$PROVIDER:8443/replicas/MySpace1/MyFile2.txt?provider_id=ASDNKJASF"
"https://$PROVIDER:8443/api/v3/oneprovider/replicas/MySpace1/MyFile2.txt?provider_id=ASDNKJASF"
```
**Get space storage qouta metric**
```bash
curl -v --tlsv1.2 -H "X-Auth-Token: $TOKEN" -X GET \
"https://$PROVIDER:8443/metrics/space/MySpace1?metric=storage_qouta"
"https://$PROVIDER:8443/api/v3/oneprovider/metrics/space/MySpace1?metric=storage_qouta"
```
More detailed examples are available in the documentation of each operation.
Expand Down
7 changes: 3 additions & 4 deletions paths/index_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ post:
type: string
description: >
The path to the index resource, including it's assigned identifier.
'400':
description: Invalid request.
schema:
Expand Down Expand Up @@ -148,11 +147,11 @@ post:
required: false
- name: body
in: body
description: The index function.
description: >
The index function.
schema:
type: string
required: true
x-code-samples:
- lang: Shell
source: "cat index.js | oneprovider-rest-cli addSpaceIndex space_id=ASLDJLASKJDLADkhhasdaksdaADS name=MyIndex1"

source: "cat index.js | oneprovider-rest-cli addSpaceIndex space_id=ASLDJLASKJDLADkhhasdaksdaADS name=MyIndex1"
9 changes: 8 additions & 1 deletion paths/replicas-path.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ post:
tags:
- Replication
summary: Replicate file or folder by path
x-bash-codegen-description: |
Replicates a file to a specified provider. This operation is asynchronous
as it can take a long time depending on the size of the data to move.
If the `path` parameter specifies a folder, entire folder is replicated to
requested provider.
description: |
Replicates a file to a specified provider. This operation is asynchronous as it can take a long time depending on the size of the data to move.
Expand All @@ -101,7 +108,7 @@ post:
{ "transferId": "b3c85b99-44db-4277-8c66-2ccd50888565" }
```
produces:
consumes:
- application/json
responses:
'200':
Expand Down
4 changes: 2 additions & 2 deletions tests/bash-swagger-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ export ONEPROVIDER_CLI=generated/bash/oneprovider-rest-cli
run bash $ONEPROVIDER_CLI getAllSpaces --dry-run X-Auth-Key:SECRET
[[ "$output" =~ "${ONEPROVIDER_HOST}/api/v3/oneprovider/spaces" ]]
[[ "$output" =~ "-X GET" ]]
[[ "$output" =~ "X-Auth-Key: SECRET" ]]
[[ "$output" =~ "X-Auth-Token: SECRET" ]]
}

@test "getAllSpaces Api key from environment variable" {
run bash $ONEPROVIDER_CLI getAllSpaces --dry-run
[[ "$output" =~ "${ONEPROVIDER_HOST}/api/v3/oneprovider/spaces" ]]
[[ "$output" =~ "-X GET" ]]
[[ "$output" =~ "X-Auth-Key: SECRET" ]]
[[ "$output" =~ "X-Auth-Token: SECRET" ]]
}

@test "getAllSpaces username and password" {
Expand Down

0 comments on commit 6b4fb2c

Please sign in to comment.