-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
root
committed
Oct 1, 2021
1 parent
72d64b0
commit d26f94f
Showing
25 changed files
with
394 additions
and
15 deletions.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| FROM i2incommon/shib-idp-ui:1.9.2 | ||
|
|
||
| ARG CSPHOSTNAME=localhost | ||
| ENV CSPHOSTNAME=$CSPHOSTNAME | ||
|
|
||
| COPY container_files/idp_ui/application.yml /opt/shibui/ | ||
| COPY container_files/idp_ui/shibui-test.p12 /opt/shibui/ | ||
| COPY container_files/idp_ui/users.txt /opt/shibui/ | ||
|
|
||
| #RUN mkdir -p /opt/shibui/saml/ | ||
| ##COPY container_files/idp_ui/samlkeystore.jks /opt/shibui/saml/ | ||
| #COPY container_files/idp_ui/idp-metadata.xml /opt/shibui/saml/ | ||
|
|
||
| #COPY container_files/system/setservername.sh /usr/local/bin/ | ||
| #RUN chmod 755 /usr/local/bin/setservername.sh | ||
| #RUN /usr/local/bin/setservername.sh | ||
|
|
||
| EXPOSE 8443 |
36 changes: 36 additions & 0 deletions
36
Workbench/idp_ui_api/container_files/idp_ui/application.yml
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,36 @@ | ||
| server: | ||
| context-path: /idpui-api | ||
| servlet: | ||
| context-path: /idpui-api | ||
| tomcat: | ||
| redirect-context-root: false | ||
| ssl: | ||
| enabled: true | ||
| key-store: /opt/shibui/shibui-test.p12 | ||
| key-store-password: testing | ||
| key-store-type: pkcs12 | ||
| key-password: testing | ||
| port: 8443 | ||
| shibui: | ||
| default-password: "{noop}letmein7" | ||
| metadataProviders: | ||
| target: "file:/generated-config/shibui-metadata-providers.xml" | ||
| metadata-dir: "/generated-metadata" | ||
| beacon-enabled: true | ||
| pac4j-enabled: true | ||
| pac4j: | ||
| type-of-auth: HEADER | ||
| authentication-header: IDPUI_API_KEY | ||
| spring: | ||
| datasource: | ||
| username: shibui | ||
| password: secret | ||
| url: jdbc:mariadb://idpui-data:3306/shibui | ||
| driverClassName: org.mariadb.jdbc.Driver | ||
| platform: mariadb | ||
| jpa: | ||
| database-platform: org.hibernate.dialect.MariaDBDialect | ||
| hibernate: | ||
| ddl-auto: update | ||
|
|
||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 00c34830-9028-418c-976c-624a61578c8f,{bcrypt}$2a$10$V1jeTIc0b2u7Y3yU.LqkXOPRVTBFc7SW07QaJR4KrBAmWGgTcO9H.,first,last,ROLE_ADMIN,user1@example.org |
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,8 @@ | ||
| #!/bin/bash | ||
|
|
||
| files="/opt/shibui/application.yml" | ||
|
|
||
| for file in $files | ||
| do | ||
| sed -i "s|__CSPHOSTNAME__|$CSPHOSTNAME|g" $file | ||
| done |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/bin/sh | ||
|
|
||
| HEADER_NAME="IDPUI_API_KEY" | ||
| HEADER_VALUE="00c34830-9028-418c-976c-624a61578c8f" | ||
|
|
||
| #first param is internal ID | ||
|
|
||
| #get the current object and add attribute release info | ||
| echo "mdload-attr:Fetching current data for object $1" | ||
| curl -k -s --location --request GET "https://localhost/idpui-api/api/EntityDescriptor/$1" \ | ||
| --header "${HEADER_NAME}: ${HEADER_VALUE}" | jq '.attributeRelease += ["eduPersonPrincipalName","mail","givenName","surname","uid"]' > json.out | ||
|
|
||
| #update the existing object with the added attribute release data | ||
| echo "mdload-attr:Adding attribute release info for object $1" | ||
| curl -k -s --location --request PUT "https://localhost/idpui-api/api/EntityDescriptor/$1" \ | ||
| --header 'Content-Type: application/json' \ | ||
| --header "${HEADER_NAME}: ${HEADER_VALUE}" \ | ||
| --data-raw "$(cat json.out)" | ||
|
|
||
| rm json.out | ||
|
|
File renamed without changes.
File renamed without changes.
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,54 @@ | ||
| #!/bin/sh | ||
|
|
||
| HEADER_NAME="IDPUI_API_KEY" | ||
| HEADER_VALUE="00c34830-9028-418c-976c-624a61578c8f" | ||
| DIR=/mdload | ||
|
|
||
| #first param is name of SP | ||
| #second param is filename of raw metadata | ||
| #third param is sleep time | ||
|
|
||
|
|
||
| pushd $DIR | ||
|
|
||
| #make sure its up | ||
| echo "mdload:Sleeping for $3 seconds to ensure availability" | ||
| sleep $3 | ||
|
|
||
| #import raw XML | ||
| echo "mdload:Importing metadata for $1..." | ||
| curl -k -s --location --request POST "https://localhost/idpui-api/api/EntityDescriptor?spName=$1" \ | ||
| --header 'Content-Type: application/xml' \ | ||
| --header "${HEADER_NAME}: ${HEADER_VALUE}" \ | ||
| --data-raw "$(cat $2)" > $DIR/output.txt | ||
|
|
||
| #get ID, set as enabled | ||
| ID=$(cat $DIR/output.txt | jq -r '.id') | ||
| echo "mdload:Fetched ID for object: $ID" | ||
| sleep 5 | ||
|
|
||
| #ensure ID isn't empty | ||
| echo "Setting $1 as enabled..." | ||
| if [[ -z "$ID" ]]; then | ||
| echo "mdload:\$ID : is EMPTY, terminating" | ||
| cat $DIR/output.txt | ||
| exit 1 | ||
| fi | ||
|
|
||
| #validate ID | ||
| if [[ $ID =~ ^\{?[A-F0-9a-f]{8}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{12}\}?$ ]]; then | ||
| echo "mdload: object ID validated" | ||
| curl -k -s --location --request PATCH "https://localhost/idpui-api/api/activate/entityDescriptor/$ID/enable" \ | ||
| --header "${HEADER_NAME}: ${HEADER_VALUE}" | ||
| else | ||
| echo "mdload:Bad response from service, terminating:" | ||
| cat $DIR/output.txt | ||
| exit 1 | ||
| fi | ||
|
|
||
| #add attribute release | ||
| $DIR/addAttrRel.sh $ID | ||
|
|
||
| rm $DIR/output.txt | ||
|
|
||
| popd |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.