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
<?php | |
declare(strict_types=1); | |
namespace App\OpenApi; | |
use ApiPlatform\Core\OpenApi\Factory\OpenApiFactory as ApiPlatformOpenApiFactory; | |
use ApiPlatform\Core\OpenApi\Factory\OpenApiFactoryInterface; | |
use ApiPlatform\Core\OpenApi\OpenApi; | |
use ApiPlatform\Core\OpenApi\Model; |
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
<?php | |
#[ApiResource( | |
operations: [ | |
// no GetCollection operation | |
new Get(...), | |
new Post(...), | |
new Patch(...), | |
], | |
)] |
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
variables: | |
# Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled | |
DOCKER_HOST: tcp://docker:2376 | |
DOCKER_TLS_CERTDIR: "/certs" | |
DOCKER_DRIVER: overlay2 | |
.bake: | |
image: docker:latest | |
services: | |
- docker:dind |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
~ Copyright 2019 Red Hat, Inc. and/or its affiliates | |
~ and other contributors as indicated by the @author tags. | |
~ | |
~ Licensed under the Apache License, Version 2.0 (the "License"); | |
~ you may not use this file except in compliance with the License. | |
~ You may obtain a copy of the License at | |
~ | |
~ http://www.apache.org/licenses/LICENSE-2.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
FORMAT: 1A | |
# Mon API de librairie | |
Pour tester, sauvegarder ce document dans un fichier library.apib | |
Installer l'outil de test `npm install -g drakov` | |
puis lancer la commande `drakov -f library.apib` | |
Testez votre API avec Insomnia. | |
# Ouvrages |
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 { SessionProvider } from "next-auth/react" | |
export default function App({ | |
Component, | |
pageProps: { session, ...pageProps }, | |
}) { | |
return ( | |
<SessionProvider session={session}> | |
<Component {...pageProps} /> | |
</SessionProvider> |
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, { AuthOptions, SessionOptions } from "next-auth"; | |
import { type TokenSet } from "next-auth/core/types"; | |
import KeycloakProvider from "next-auth/providers/keycloak"; | |
import { OIDC_CLIENT_ID, OIDC_SERVER_URL } from "../../../config/keycloak"; | |
interface Session extends SessionOptions { | |
accessToken: string | |
error?: "RefreshAccessTokenError" | |
} |
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 KeycloakProvider from "next-auth/providers/keycloak" | |
export const authOptions = { | |
// Configure one or more authentication providers | |
providers: [ | |
KeycloakProvider({ | |
id: 'keycloak', | |
clientId: process.env.OIDC_CLIENT_ID, | |
issuer: process.env.OIDC_SERVER_URL, |
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
security: | |
firewalls: | |
main: | |
access_token: | |
token_handler: | |
# OIDC_SERVER_URL_INTERNAL: https://caddy/oidc/realms/demo | |
oidc_user_info: '%env(OIDC_SERVER_URL_INTERNAL)%/protocol/openid-connect/userinfo' |
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
# ... | |
# Matches requests for OIDC routes | |
@oidc expression path('/oidc/*') | |
route { | |
# ... | |
reverse_proxy @oidc http://{$OIDC_UPSTREAM} | |
} |
NewerOlder