Giter VIP home page Giter VIP logo

ajava's Introduction

☕ AJAVA

Ce repository contient le code source du TP sur le développement d'API en JAVA/Spring.

💻 Installation

Vous devez avoir sur votre poste :

  • JAVA en version 17
  • DOCKER (et docker-compose)

🚀 Démarrage

Application Spring-Boot

Pour démarrer l'application, jouer la commande suivante :

  • sur linux / macos :
    ./gradlew bootRun
  • sur windows :
    ./gradlew.bat bootRun

L'application démarre sur le port par défaut de Spring-Boot, 8080.

La base de données

Pour démarrer la BDD, il faut démarrer un container avec la commande :

docker-compose up -d

La BDD démarre sur le port 15432.

Les informations de la BDD comme le login, le password, le port, la bddname sont disponibles dans le fichier docker-compose.yml

Accès à l'API avec Swagger-UI

Ouvrir la page http://localhost:8080/swagger-ui/index.html

Swagger UI

✅ Tests

Pour lancer tous les tests :

  • sur linux / macos
    ./gradlew test
  • sur windows
    ./gradlew.bat test

Prerequis pour l'API TMDB

  • Obtenir un compte pour utiliser l'API TMDB : Page d'inscription
  • Après l'inscription, votre Jeton d'accès en lecture à l'API va être généré : https://www.themoviedb.org/settings/api Token API TMDB
  • Créer un fichier src/main/resources/.env, avec le même contenu que le fichier .env.exemple
  • Remplacer <METTRE ICI LE JETON TMDB> par votre Jeton d'accès à l'API TMDB

TP Sécuriser son API Java avec Spring Security

🙍 👮‍♀️ Utilisateurs déjà créés

Authentification username Password UserId Roles
Basic Auth user password user USER
Basic Auth jdurant password jdurant USER
Basic Auth admin password admin ADMIN, USER
OAuth 2.0 jeandurant password jdurant USER

🗝️ Utilisation d'une Basic Authentification

Gestion de l'authentification in-memory

🔑 Utilisation d'OAuth 2.0


Documentations officielles

Documentations Spring

Guides

Liens supplémentaires

ajava's People

Contributors

chrc avatar dependabot[bot] avatar octo-clem avatar kevin-julien avatar stkoman avatar tchdvlp avatar

Stargazers

Callahan Ringquist avatar Pierre-Yves Fourmond avatar

Watchers

Jérémie Klein avatar  avatar James Cloos avatar Julien Vignolles avatar Arnaud Doucerain avatar Jean-Sébastien Dupuis avatar  avatar Antoine Mazure avatar

ajava's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.