-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Control Plane API call to add apikey for Iglu authentication (closes
#116)
- Loading branch information
1 parent
3963e79
commit f776b87
Showing
5 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
provisioning/resources/control-plane/scripts/add_iglu_server_super_uuid.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
iglu_server_super_uid=$1 | ||
config_dir=$2 | ||
|
||
iglu_resolver_config_dir="$config_dir/iglu-resolver.json" | ||
|
||
##there will be only one local iglu server, therefore apikey will be added for this iglu server | ||
n=$(awk '/localhost/{print NR}' $iglu_resolver_config_dir) ## find number of the line which contains "localhost" | ||
n=$((n+1)) ##add one to line number which contains 'localhost' keyword, this line will contain apikey for local iglu server | ||
sudo sed -i ''$n's/\(.*"apikey":\)\(.*\)/\1 "'$iglu_server_super_uid'"/' $iglu_resolver_config_dir ##write apikey for local iglu server | ||
|
||
#write super apikey to db | ||
export PGPASSWORD=snowplow | ||
delete_all_apikeys="DELETE FROM apikeys" | ||
iglu_server_setup="INSERT INTO apikeys (uid, vendor_prefix, permission, createdat) VALUES ('${iglu_server_super_uid}','*','super',current_timestamp);" | ||
psql --host=localhost --port=5432 --username=snowplow --dbname=iglu -c "${delete_all_apikeys}" | ||
psql --host=localhost --port=5432 --username=snowplow --dbname=iglu -c "${iglu_server_setup}" |
Binary file modified
BIN
+5.07 KB
(100%)
provisioning/resources/control-plane/snowplow-mini-control-plane-api
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters