2020-06-29 08:43:46 +00:00
|
|
|
source .env
|
|
|
|
TOKEN=$(go run -mod=vendor cmd/signjwt/*.go $SECRET)
|
2020-07-17 05:41:04 +00:00
|
|
|
AUTH_URL=${AUTH_URL:-"http://mgmt.example.com:3010"}
|
2020-06-29 08:43:46 +00:00
|
|
|
|
|
|
|
CLIENT_SUBJECT=${CLIENT_SUBJECT:-"newbie"}
|
2020-07-17 05:41:04 +00:00
|
|
|
curl -X POST $AUTH_URL/api/devices \
|
2020-06-29 08:43:46 +00:00
|
|
|
-H "Authorization: Bearer ${TOKEN}" \
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
-d '{ "slug": "'$CLIENT_SUBJECT'" }'
|