Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swagger ui implemented #3

Merged
merged 1 commit into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Demo1

This is a Spring Boot application that demonstrates the use of various Spring modules and JWT for security.

## Technologies Used

- Spring Boot 3
- Spring Security 6
- Spring Data JPA 3
- Spring Data REST 3
- JWT
- Lombok
- Maven
- PostgreSQL
- Springdoc OpenAPI
- Swagger UI

## Installation

To install the project, clone the repository and run the following command:

```bash
mvn clean install
```

## Helpful Links from the project

- [Swagger UI](http://localhost:8080/swagger-ui.html)
- [Springdoc OpenAPI](http://localhost:8080/v3/api-docs)
6,058 changes: 219 additions & 5,839 deletions logdir/spring.log

Large diffs are not rendered by default.

Binary file removed logdir/spring.log.2024-07-23.0.gz
Binary file not shown.
Binary file removed logdir/spring.log.2024-07-24.0.gz
Binary file not shown.
Binary file added logdir/spring.log.2024-07-30.0.gz
Binary file not shown.
Binary file added logdir/spring.log.2024-07-31.0.gz
Binary file not shown.
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.5.0</version>
</dependency>
</dependencies>

<build>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/example/demo/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
.requestMatchers(HttpMethod.DELETE, "/api/v1/**").hasAuthority("ADMIN")
.requestMatchers(HttpMethod.POST, "/api/v1/posts/**").hasAnyAuthority("ADMIN", "USER")
.requestMatchers(HttpMethod.GET, "/api/v1/posts/**").permitAll()
.requestMatchers("/v3/api-docs/**",
"/swagger-ui/**",
"/swagger-ui.html").permitAll()
.anyRequest()
.authenticated()
).userDetailsService(userService)
Expand Down