Skip to content

Commit

Permalink
[NOTASK]
Browse files Browse the repository at this point in the history
postgres test
  • Loading branch information
jj committed Dec 3, 2019
1 parent c0dd943 commit 6080932
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.HashSet;
import java.util.Set;
Expand All @@ -31,6 +32,7 @@
@Setter
@EqualsAndHashCode(callSuper = true, exclude = "roles")
@ToString(exclude = "roles")
@Table(name = "USERS")
public class User extends AbstractAuditable {

@Column(nullable = false, unique = true)
Expand Down
138 changes: 138 additions & 0 deletions testbed/postgres/conf/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
spring:
profiles:
include:
datasource:
platform: postgres
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://db:5432/shibui
username: shibui
password: shibui
jpa:
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
server:
port: 8443
ssl:
key-store: "/conf/keystore.p12"
key-store-password: "changeit"
keyStoreType: "PKCS12"
keyAlias: "tomcat"
shibui:
user-bootstrap-resource: file:/conf/users.csv
roles: ROLE_ADMIN,ROLE_NONE,ROLE_USER,ROLE_PONY
custom:
attributes:
# Default attributes
- name: eduPersonPrincipalName
displayName: label.attribute-eduPersonPrincipalName
- name: uid
displayName: label.attribute-uid
- name: mail
displayName: label.attribute-mail
- name: surname
displayName: label.attribute-surname
- name: givenName
displayName: label.attribute-givenName
- name: eduPersonAffiliation
displayName: label.attribute-eduPersonAffiliation
- name: eduPersonScopedAffiliation
displayName: label.attribute-eduPersonScopedAffiliation
- name: eduPersonPrimaryAffiliation
displayName: label.attribute-eduPersonPrimaryAffiliation
- name: eduPersonEntitlement
displayName: label.attribute-eduPersonEntitlement
- name: eduPersonAssurance
displayName: label.attribute-eduPersonAssurance
- name: eduPersonUniqueId
displayName: label.attribute-eduPersonUniqueId
- name: employeeNumber
displayName: label.attribute-employeeNumber
# Custom attributes
overrides:
# Default overrides
- name: signAssertion
displayName: label.sign-the-assertion
displayType: boolean
defaultValue: false
helpText: tooltip.sign-assertion
attributeName: http://shibboleth.net/ns/profiles/saml2/sso/browser/signAssertions
attributeFriendlyName: signAssertions
- name: dontSignResponse
displayName: label.dont-sign-the-response
displayType: boolean
defaultValue: false
helpText: tooltip.dont-sign-response
attributeName: http://shibboleth.net/ns/profiles/saml2/sso/browser/signResponses
attributeFriendlyName: signResponses
- name: turnOffEncryption
displayName: label.turn-off-encryption-of-response
displayType: boolean
defaultValue: false
helpText: tooltip.turn-off-encryption
attributeName: http://shibboleth.net/ns/profiles/encryptAssertions
attributeFriendlyName: encryptAssertions
- name: useSha
displayName: label.use-sha1-signing-algorithm
displayType: boolean
defaultValue: false
helpText: tooltip.usa-sha-algorithm
persistType: string
persistValue: shibboleth.SecurityConfiguration.SHA1
attributeName: http://shibboleth.net/ns/profiles/securityConfiguration
attributeFriendlyName: securityConfiguration
- name: ignoreAuthenticationMethod
displayName: label.ignore-any-sp-requested-authentication-method
displayType: boolean
defaultValue: false
helpText: tooltip.ignore-auth-method
persistType: string
persistValue: 0x1
attributeName: http://shibboleth.net/ns/profiles/disallowedFeatures
attributeFriendlyName: disallowedFeatures
- name: omitNotBefore
displayName: label.omit-not-before-condition
displayType: boolean
defaultValue: false
helpText: tooltip.omit-not-before-condition
attributeName: http://shibboleth.net/ns/profiles/includeConditionsNotBefore
attributeFriendlyName: includeConditionsNotBefore
- name: responderId
displayName: label.responder-id
displayType: string
defaultValue: null
helpText: tooltip.responder-id
attributeName: http://shibboleth.net/ns/profiles/responderId
attributeFriendlyName: responderId
- name: nameIdFormats
displayName: label.nameid-format-to-send
displayType: set
helpText: tooltip.nameid-format
defaultValues:
- urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
- urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
- urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
- urn:oasis:names:tc:SAML:2.0:nameid-format:transient
attributeName: http://shibboleth.net/ns/profiles/nameIDFormatPrecedence
attributeFriendlyName: nameIDFormatPrecedence
- name: authenticationMethods
displayName: label.authentication-methods-to-use
displayType: set
helpText: tooltip.authentication-methods-to-use
defaultValues:
- https://refeds.org/profile/mfa
- urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken
- urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
attributeName: http://shibboleth.net/ns/profiles/defaultAuthenticationMethods
attributeFriendlyName: defaultAuthenticationMethods
- name: forceAuthn
displayName: label.force-authn
displayType: boolean
defaultValue: false
helpText: tooltip.force-authn
attributeName: http://shibboleth.net/ns/profiles/forceAuthn
attributeFriendlyName: forceAuthn
logging:
level:
org.pac4j: "TRACE"
org.opensaml: "INFO"
Binary file added testbed/postgres/conf/keystore.p12
Binary file not shown.
2 changes: 2 additions & 0 deletions testbed/postgres/conf/users.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
root,{bcrypt}$2a$10$V1jeTIc0b2u7Y3yU.LqkXOPRVTBFc7SW07QaJR4KrBAmWGgTcO9H.,first,last,ROLE_ADMIN,user1@example.org
jj,{bcrypt}$2a$10$V1jeTIc0b2u7Y3yU.LqkXOPRVTBFc7SW07QaJR4KrBAmWGgTcO9H.,first,last,ROLE_ADMIN,jj@example.org
39 changes: 39 additions & 0 deletions testbed/postgres/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: "3.7"

services:
db:
image: postgres
container_name: db
environment:
POSTGRES_USER: shibui
POSTGRES_PASSWORD: shibui
POSTGRES_DB: shibui
networks:
- front
ports:
- 3306:3306
shibui:
image: unicon/shibui
ports:
- 8080:8080
- 5005:5005
- 8443:8443
volumes:
- ./conf:/conf
- ./conf/application.yml:/application.yml
networks:
- front
depends_on:
- db
mailhog:
image: mailhog/mailhog:latest
ports:
- 1025:1025
- 8025:8025
container_name: mailhog
networks:
- front

networks:
front:
driver: bridge

0 comments on commit 6080932

Please sign in to comment.