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
OIDC_SERVER_URL=https://localhost/oidc/realms/demo | |
OIDC_SWAGGER_CLIENT_ID=api-platform-swagger |
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
# config/packages/security.yaml | |
security: | |
enable_authenticator_manager: true | |
providers: | |
app_user_provider: | |
entity: | |
class: App\Entity\User | |
property: email | |
firewalls: | |
main: |
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
# config/packages/hwi_oauth.yaml | |
hwi_oauth: | |
resource_owners: | |
keycloak: | |
type: keycloak | |
base_url: <keycloak_url> # should look like https://www.example.com/auth | |
realm: <realm_name> | |
client_id: <client_id> | |
client_secret: <client_secret> |
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
# docker-compose.yaml | |
version: "3.8" | |
services: | |
keycloak-database: | |
image: postgres:15-alpine | |
volumes: | |
- keycloak_db_data:/var/lib/postgresql/data:rw | |
environment: | |
POSTGRES_DB: keycloak |
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
fixInterfaceScope() { | |
interface=tunsnx | |
data=($(ip -o address show "$interface" | awk -F ' +' '{print $4 " " $6 " " $8}')) | |
LOCAL_ADDRESS_INDEX=1 | |
PEER_ADDRESS_INDEX=2 | |
SCOPE_INDEX=3 | |
if [ "${data[$SCOPE_INDEX]}" = "global" ] | |
then | |
echo "Interface ${interface} is already set to global scope. Skip!" | |
return |
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
import NextAuth from "next-auth"; | |
import Providers from "next-auth/providers"; | |
import {fetch} from "utils/dataAccess"; | |
const options = { | |
providers: [ | |
Providers.Credentials({ | |
name: 'Credentials', | |
authorize: async (credentials) => { | |
const response = await fetch("/login_check", { |
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
#!/usr/bin/env php | |
<?php | |
/** | |
* Create the bin/reserved file in your project, and copy/paste this as content | |
* Add execution permissions: chmod +x bin/reserved | |
*/ | |
set_time_limit(0); |
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
Cypress.Commands.add('iframe', { | |
prevSubject: 'element', | |
}, $iframe => { | |
const contentWindow = $iframe.prop('contentWindow'); | |
return new Promise(resolve => { | |
if (contentWindow && contentWindow.document.readyState === 'complete') { | |
resolve(contentWindow); | |
} else { | |
$iframe.on('load', () => { |
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
Cypress.Cookies.defaults({ | |
whitelist: 'PHPSESSID', | |
}); |
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
before(() => { | |
Cypress.log({}); | |
cy.request('https://unpkg.com/unfetch@4.1.0/dist/unfetch.umd.js', {log: false}).as('unfetch').then(unfetch => { | |
Cypress.on('window:before:load', win => { | |
delete win.fetch; | |
win.eval(unfetch); | |
win.fetch = win.unfetch; | |
}); | |
}); |