feat: ditch ldap, local auth
This commit is contained in:
parent
927c117822
commit
eb5616fd7a
File diff suppressed because it is too large
Load Diff
4905
.bloop/backend.json
4905
.bloop/backend.json
File diff suppressed because it is too large
Load Diff
@ -1,23 +0,0 @@
|
||||
{
|
||||
"javaSemanticDBVersion": "0.9.10",
|
||||
"semanticDBVersion": "4.9.3",
|
||||
"supportedScalaVersions": [
|
||||
"2.13.14",
|
||||
"2.12.19",
|
||||
"2.12.18",
|
||||
"2.12.17",
|
||||
"2.12.16",
|
||||
"2.13.11",
|
||||
"2.13.12",
|
||||
"2.13.13",
|
||||
"2.11.12",
|
||||
"2.12.12",
|
||||
"2.12.13",
|
||||
"2.12.14",
|
||||
"2.12.15",
|
||||
"2.13.7",
|
||||
"2.13.8",
|
||||
"2.13.9",
|
||||
"2.13.10"
|
||||
]
|
||||
}
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "src/main/webui"]
|
||||
path = src/main/webui
|
||||
url = git@git.la-banquise.fr:malopieds/intra-back.git
|
@ -1,60 +0,0 @@
|
||||
file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/AdminResource.java
|
||||
### java.util.NoSuchElementException: next on empty iterator
|
||||
|
||||
occurred in the presentation compiler.
|
||||
|
||||
presentation compiler configuration:
|
||||
Scala version: 3.3.3
|
||||
Classpath:
|
||||
<HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.3/scala3-library_3-3.3.3.jar [exists ], <HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar [exists ]
|
||||
Options:
|
||||
|
||||
|
||||
|
||||
action parameters:
|
||||
uri: file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/AdminResource.java
|
||||
text:
|
||||
```scala
|
||||
package fr.la_banquise.backend;
|
||||
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import io.quarkus.security.Authenticated;
|
||||
|
||||
@Path("/api/admin")
|
||||
@Authenticated
|
||||
public class AdminResource {
|
||||
@GET
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String admin() {
|
||||
return "granted";
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Error stacktrace:
|
||||
|
||||
```
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:973)
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:971)
|
||||
scala.collection.mutable.MutationTracker$CheckedIterator.next(MutationTracker.scala:76)
|
||||
scala.collection.IterableOps.head(Iterable.scala:222)
|
||||
scala.collection.IterableOps.head$(Iterable.scala:222)
|
||||
scala.collection.AbstractIterable.head(Iterable.scala:933)
|
||||
dotty.tools.dotc.interactive.InteractiveDriver.run(InteractiveDriver.scala:168)
|
||||
scala.meta.internal.pc.MetalsDriver.run(MetalsDriver.scala:45)
|
||||
scala.meta.internal.pc.PcCollector.<init>(PcCollector.scala:44)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider$Collector$.<init>(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector$lzyINIT1(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.provide(PcSemanticTokensProvider.scala:90)
|
||||
scala.meta.internal.pc.ScalaPresentationCompiler.semanticTokens$$anonfun$1(ScalaPresentationCompiler.scala:110)
|
||||
```
|
||||
#### Short summary:
|
||||
|
||||
java.util.NoSuchElementException: next on empty iterator
|
@ -1,71 +0,0 @@
|
||||
file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/Test.java
|
||||
### java.util.NoSuchElementException: next on empty iterator
|
||||
|
||||
occurred in the presentation compiler.
|
||||
|
||||
presentation compiler configuration:
|
||||
Scala version: 3.3.3
|
||||
Classpath:
|
||||
<HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.3/scala3-library_3-3.3.3.jar [exists ], <HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar [exists ]
|
||||
Options:
|
||||
|
||||
|
||||
|
||||
action parameters:
|
||||
uri: file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/Test.java
|
||||
text:
|
||||
```scala
|
||||
package fr.la_banquise.backend;
|
||||
|
||||
import org.eclipse.microprofile.jwt.JsonWebToken;
|
||||
|
||||
import io.quarkus.security.Authenticated;
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
* Test
|
||||
*/
|
||||
@Path("/admin")
|
||||
public class Test {
|
||||
|
||||
@Inject
|
||||
JsonWebToken jwt;
|
||||
|
||||
@GET
|
||||
@RolesAllowed("user")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String test(){
|
||||
return "Access for subject " + jwt.getSubject() + " is granted";
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Error stacktrace:
|
||||
|
||||
```
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:973)
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:971)
|
||||
scala.collection.mutable.MutationTracker$CheckedIterator.next(MutationTracker.scala:76)
|
||||
scala.collection.IterableOps.head(Iterable.scala:222)
|
||||
scala.collection.IterableOps.head$(Iterable.scala:222)
|
||||
scala.collection.AbstractIterable.head(Iterable.scala:933)
|
||||
dotty.tools.dotc.interactive.InteractiveDriver.run(InteractiveDriver.scala:168)
|
||||
scala.meta.internal.pc.MetalsDriver.run(MetalsDriver.scala:45)
|
||||
scala.meta.internal.pc.PcCollector.<init>(PcCollector.scala:44)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider$Collector$.<init>(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector$lzyINIT1(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.provide(PcSemanticTokensProvider.scala:90)
|
||||
scala.meta.internal.pc.ScalaPresentationCompiler.semanticTokens$$anonfun$1(ScalaPresentationCompiler.scala:110)
|
||||
```
|
||||
#### Short summary:
|
||||
|
||||
java.util.NoSuchElementException: next on empty iterator
|
@ -1,82 +0,0 @@
|
||||
file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/data/model/TpModel.java
|
||||
### java.util.NoSuchElementException: next on empty iterator
|
||||
|
||||
occurred in the presentation compiler.
|
||||
|
||||
presentation compiler configuration:
|
||||
Scala version: 3.3.3
|
||||
Classpath:
|
||||
<HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.3/scala3-library_3-3.3.3.jar [exists ], <HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar [exists ]
|
||||
Options:
|
||||
|
||||
|
||||
|
||||
action parameters:
|
||||
uri: file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/data/model/TpModel.java
|
||||
text:
|
||||
```scala
|
||||
package fr.la_banquise.backend.data.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
/**
|
||||
* TpModel
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "tps")
|
||||
public class TpModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
public Long id;
|
||||
public String name;
|
||||
public String description;
|
||||
|
||||
public String pdfLink;
|
||||
public String givenLink;
|
||||
public String respo;
|
||||
public String endDate;
|
||||
|
||||
public TpModel(String name, String description, String pdfLink, String givenLink, String respo, String endDate) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.pdfLink = pdfLink;
|
||||
this.givenLink = givenLink;
|
||||
this.respo = respo;
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public TpModel() {
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Error stacktrace:
|
||||
|
||||
```
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:973)
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:971)
|
||||
scala.collection.mutable.MutationTracker$CheckedIterator.next(MutationTracker.scala:76)
|
||||
scala.collection.IterableOps.head(Iterable.scala:222)
|
||||
scala.collection.IterableOps.head$(Iterable.scala:222)
|
||||
scala.collection.AbstractIterable.head(Iterable.scala:933)
|
||||
dotty.tools.dotc.interactive.InteractiveDriver.run(InteractiveDriver.scala:168)
|
||||
scala.meta.internal.pc.MetalsDriver.run(MetalsDriver.scala:45)
|
||||
scala.meta.internal.pc.PcCollector.<init>(PcCollector.scala:44)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider$Collector$.<init>(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector$lzyINIT1(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.provide(PcSemanticTokensProvider.scala:90)
|
||||
scala.meta.internal.pc.ScalaPresentationCompiler.semanticTokens$$anonfun$1(ScalaPresentationCompiler.scala:110)
|
||||
```
|
||||
#### Short summary:
|
||||
|
||||
java.util.NoSuchElementException: next on empty iterator
|
@ -1,71 +0,0 @@
|
||||
file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/Test.java
|
||||
### java.util.NoSuchElementException: next on empty iterator
|
||||
|
||||
occurred in the presentation compiler.
|
||||
|
||||
presentation compiler configuration:
|
||||
Scala version: 3.3.3
|
||||
Classpath:
|
||||
<HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.3/scala3-library_3-3.3.3.jar [exists ], <HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar [exists ]
|
||||
Options:
|
||||
|
||||
|
||||
|
||||
action parameters:
|
||||
uri: file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/Test.java
|
||||
text:
|
||||
```scala
|
||||
package fr.la_banquise.backend;
|
||||
|
||||
import org.eclipse.microprofile.jwt.JsonWebToken;
|
||||
|
||||
import io.quarkus.security.Authenticated;
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
* Test
|
||||
*/
|
||||
@Path("/admin")
|
||||
public class Test {
|
||||
|
||||
@Inject
|
||||
JsonWebToken jwt;
|
||||
|
||||
@GET
|
||||
@RolesAllowed("user")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String test(){
|
||||
return "Access for subject " + jwt.getSubject() + " is granted";
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Error stacktrace:
|
||||
|
||||
```
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:973)
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:971)
|
||||
scala.collection.mutable.MutationTracker$CheckedIterator.next(MutationTracker.scala:76)
|
||||
scala.collection.IterableOps.head(Iterable.scala:222)
|
||||
scala.collection.IterableOps.head$(Iterable.scala:222)
|
||||
scala.collection.AbstractIterable.head(Iterable.scala:933)
|
||||
dotty.tools.dotc.interactive.InteractiveDriver.run(InteractiveDriver.scala:168)
|
||||
scala.meta.internal.pc.MetalsDriver.run(MetalsDriver.scala:45)
|
||||
scala.meta.internal.pc.PcCollector.<init>(PcCollector.scala:44)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider$Collector$.<init>(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector$lzyINIT1(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.provide(PcSemanticTokensProvider.scala:90)
|
||||
scala.meta.internal.pc.ScalaPresentationCompiler.semanticTokens$$anonfun$1(ScalaPresentationCompiler.scala:110)
|
||||
```
|
||||
#### Short summary:
|
||||
|
||||
java.util.NoSuchElementException: next on empty iterator
|
@ -1,70 +0,0 @@
|
||||
file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/Test.java
|
||||
### java.util.NoSuchElementException: next on empty iterator
|
||||
|
||||
occurred in the presentation compiler.
|
||||
|
||||
presentation compiler configuration:
|
||||
Scala version: 3.3.3
|
||||
Classpath:
|
||||
<HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.3/scala3-library_3-3.3.3.jar [exists ], <HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar [exists ]
|
||||
Options:
|
||||
|
||||
|
||||
|
||||
action parameters:
|
||||
uri: file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/Test.java
|
||||
text:
|
||||
```scala
|
||||
package fr.la_banquise.backend;
|
||||
|
||||
import org.eclipse.microprofile.jwt.JsonWebToken;
|
||||
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
* Test
|
||||
*/
|
||||
@Path("/admin")
|
||||
public class Test {
|
||||
|
||||
@Inject
|
||||
JsonWebToken jwt;
|
||||
|
||||
@GET
|
||||
@RolesAllowed("user")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String test(){
|
||||
return "Access for subject " + jwt.getSubject() + " is granted";
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Error stacktrace:
|
||||
|
||||
```
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:973)
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:971)
|
||||
scala.collection.mutable.MutationTracker$CheckedIterator.next(MutationTracker.scala:76)
|
||||
scala.collection.IterableOps.head(Iterable.scala:222)
|
||||
scala.collection.IterableOps.head$(Iterable.scala:222)
|
||||
scala.collection.AbstractIterable.head(Iterable.scala:933)
|
||||
dotty.tools.dotc.interactive.InteractiveDriver.run(InteractiveDriver.scala:168)
|
||||
scala.meta.internal.pc.MetalsDriver.run(MetalsDriver.scala:45)
|
||||
scala.meta.internal.pc.PcCollector.<init>(PcCollector.scala:44)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider$Collector$.<init>(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector$lzyINIT1(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.provide(PcSemanticTokensProvider.scala:90)
|
||||
scala.meta.internal.pc.ScalaPresentationCompiler.semanticTokens$$anonfun$1(ScalaPresentationCompiler.scala:110)
|
||||
```
|
||||
#### Short summary:
|
||||
|
||||
java.util.NoSuchElementException: next on empty iterator
|
@ -1,82 +0,0 @@
|
||||
file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/data/model/TpModel.java
|
||||
### java.util.NoSuchElementException: next on empty iterator
|
||||
|
||||
occurred in the presentation compiler.
|
||||
|
||||
presentation compiler configuration:
|
||||
Scala version: 3.3.3
|
||||
Classpath:
|
||||
<HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.3/scala3-library_3-3.3.3.jar [exists ], <HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar [exists ]
|
||||
Options:
|
||||
|
||||
|
||||
|
||||
action parameters:
|
||||
uri: file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/data/model/TpModel.java
|
||||
text:
|
||||
```scala
|
||||
package fr.la_banquise.backend.data.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
/**
|
||||
* TpModel
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "tps")
|
||||
public class TpModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
public Long id;
|
||||
public String name;
|
||||
public String description;
|
||||
|
||||
public String pdfLink;
|
||||
public String givenLink;
|
||||
public String respo;
|
||||
public String endDate;
|
||||
|
||||
public TpModel(String name, String description, String pdfLink, String givenLink, String respo, String endDate) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.pdfLink = pdfLink;
|
||||
this.givenLink = givenLink;
|
||||
this.respo = respo;
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public TpModel() {
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Error stacktrace:
|
||||
|
||||
```
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:973)
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:971)
|
||||
scala.collection.mutable.MutationTracker$CheckedIterator.next(MutationTracker.scala:76)
|
||||
scala.collection.IterableOps.head(Iterable.scala:222)
|
||||
scala.collection.IterableOps.head$(Iterable.scala:222)
|
||||
scala.collection.AbstractIterable.head(Iterable.scala:933)
|
||||
dotty.tools.dotc.interactive.InteractiveDriver.run(InteractiveDriver.scala:168)
|
||||
scala.meta.internal.pc.MetalsDriver.run(MetalsDriver.scala:45)
|
||||
scala.meta.internal.pc.PcCollector.<init>(PcCollector.scala:44)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider$Collector$.<init>(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector$lzyINIT1(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.provide(PcSemanticTokensProvider.scala:90)
|
||||
scala.meta.internal.pc.ScalaPresentationCompiler.semanticTokens$$anonfun$1(ScalaPresentationCompiler.scala:110)
|
||||
```
|
||||
#### Short summary:
|
||||
|
||||
java.util.NoSuchElementException: next on empty iterator
|
@ -1,81 +0,0 @@
|
||||
file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/data/model/TpModel.java
|
||||
### java.util.NoSuchElementException: next on empty iterator
|
||||
|
||||
occurred in the presentation compiler.
|
||||
|
||||
presentation compiler configuration:
|
||||
Scala version: 3.3.3
|
||||
Classpath:
|
||||
<HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.3/scala3-library_3-3.3.3.jar [exists ], <HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar [exists ]
|
||||
Options:
|
||||
|
||||
|
||||
|
||||
action parameters:
|
||||
uri: file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/data/model/TpModel.java
|
||||
text:
|
||||
```scala
|
||||
package fr.la_banquise.backend.data.model;
|
||||
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
/**
|
||||
* TpModel
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "tps")
|
||||
public class TpModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
public Long id;
|
||||
public String name;
|
||||
public String description;
|
||||
|
||||
public String pdfLink;
|
||||
public String givenLink;
|
||||
public String respo;
|
||||
public String endDate;
|
||||
|
||||
public TpModel(String name, String description, String pdfLink, String givenLink, String respo, String endDate) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.pdfLink = pdfLink;
|
||||
this.givenLink = givenLink;
|
||||
this.respo = respo;
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public TpModel() {
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Error stacktrace:
|
||||
|
||||
```
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:973)
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:971)
|
||||
scala.collection.mutable.MutationTracker$CheckedIterator.next(MutationTracker.scala:76)
|
||||
scala.collection.IterableOps.head(Iterable.scala:222)
|
||||
scala.collection.IterableOps.head$(Iterable.scala:222)
|
||||
scala.collection.AbstractIterable.head(Iterable.scala:933)
|
||||
dotty.tools.dotc.interactive.InteractiveDriver.run(InteractiveDriver.scala:168)
|
||||
scala.meta.internal.pc.MetalsDriver.run(MetalsDriver.scala:45)
|
||||
scala.meta.internal.pc.PcCollector.<init>(PcCollector.scala:44)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider$Collector$.<init>(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector$lzyINIT1(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.provide(PcSemanticTokensProvider.scala:90)
|
||||
scala.meta.internal.pc.ScalaPresentationCompiler.semanticTokens$$anonfun$1(ScalaPresentationCompiler.scala:110)
|
||||
```
|
||||
#### Short summary:
|
||||
|
||||
java.util.NoSuchElementException: next on empty iterator
|
@ -1,73 +0,0 @@
|
||||
file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/domain/entity/TpItemEntity.java
|
||||
### java.util.NoSuchElementException: next on empty iterator
|
||||
|
||||
occurred in the presentation compiler.
|
||||
|
||||
presentation compiler configuration:
|
||||
Scala version: 3.3.3
|
||||
Classpath:
|
||||
<HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.3/scala3-library_3-3.3.3.jar [exists ], <HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar [exists ]
|
||||
Options:
|
||||
|
||||
|
||||
|
||||
action parameters:
|
||||
uri: file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/domain/entity/TpItemEntity.java
|
||||
text:
|
||||
```scala
|
||||
package fr.la_banquise.backend.domain.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TpItemEntity
|
||||
*/
|
||||
public class TpItemEntity {
|
||||
public Long id;
|
||||
public String name;
|
||||
public String description;
|
||||
public String pdfLink;
|
||||
public String givenLink;
|
||||
public String respo;
|
||||
public String endDate;
|
||||
|
||||
public TpItemEntity(Long id, String name, String description,String pdfLink, String givenLink, String respo, String endDate) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.pdfLink = pdfLink;
|
||||
this.givenLink = givenLink;
|
||||
this.respo = respo;
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public TpItemEntity() {
|
||||
//TODO Auto-generated constructor stub
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Error stacktrace:
|
||||
|
||||
```
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:973)
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:971)
|
||||
scala.collection.mutable.MutationTracker$CheckedIterator.next(MutationTracker.scala:76)
|
||||
scala.collection.IterableOps.head(Iterable.scala:222)
|
||||
scala.collection.IterableOps.head$(Iterable.scala:222)
|
||||
scala.collection.AbstractIterable.head(Iterable.scala:933)
|
||||
dotty.tools.dotc.interactive.InteractiveDriver.run(InteractiveDriver.scala:168)
|
||||
scala.meta.internal.pc.MetalsDriver.run(MetalsDriver.scala:45)
|
||||
scala.meta.internal.pc.PcCollector.<init>(PcCollector.scala:44)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider$Collector$.<init>(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector$lzyINIT1(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.provide(PcSemanticTokensProvider.scala:90)
|
||||
scala.meta.internal.pc.ScalaPresentationCompiler.semanticTokens$$anonfun$1(ScalaPresentationCompiler.scala:110)
|
||||
```
|
||||
#### Short summary:
|
||||
|
||||
java.util.NoSuchElementException: next on empty iterator
|
@ -1,73 +0,0 @@
|
||||
file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/domain/entity/TpItemEntity.java
|
||||
### java.util.NoSuchElementException: next on empty iterator
|
||||
|
||||
occurred in the presentation compiler.
|
||||
|
||||
presentation compiler configuration:
|
||||
Scala version: 3.3.3
|
||||
Classpath:
|
||||
<HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.3/scala3-library_3-3.3.3.jar [exists ], <HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar [exists ]
|
||||
Options:
|
||||
|
||||
|
||||
|
||||
action parameters:
|
||||
uri: file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/domain/entity/TpItemEntity.java
|
||||
text:
|
||||
```scala
|
||||
package fr.la_banquise.backend.domain.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TpItemEntity
|
||||
*/
|
||||
public class TpItemEntity {
|
||||
public Long id;
|
||||
public String name;
|
||||
public String description;
|
||||
public String pdfLink;
|
||||
public String givenLink;
|
||||
public String respo;
|
||||
public String endDate;
|
||||
|
||||
public TpItemEntity(Long id, String name, String description,String pdfLink, String givenLink, String respo, String endDate) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.pdfLink = pdfLink;
|
||||
this.givenLink = givenLink;
|
||||
this.respo = respo;
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public TpItemEntity() {
|
||||
//TODO Auto-generated constructor stub
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Error stacktrace:
|
||||
|
||||
```
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:973)
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:971)
|
||||
scala.collection.mutable.MutationTracker$CheckedIterator.next(MutationTracker.scala:76)
|
||||
scala.collection.IterableOps.head(Iterable.scala:222)
|
||||
scala.collection.IterableOps.head$(Iterable.scala:222)
|
||||
scala.collection.AbstractIterable.head(Iterable.scala:933)
|
||||
dotty.tools.dotc.interactive.InteractiveDriver.run(InteractiveDriver.scala:168)
|
||||
scala.meta.internal.pc.MetalsDriver.run(MetalsDriver.scala:45)
|
||||
scala.meta.internal.pc.PcCollector.<init>(PcCollector.scala:44)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider$Collector$.<init>(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector$lzyINIT1(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.provide(PcSemanticTokensProvider.scala:90)
|
||||
scala.meta.internal.pc.ScalaPresentationCompiler.semanticTokens$$anonfun$1(ScalaPresentationCompiler.scala:110)
|
||||
```
|
||||
#### Short summary:
|
||||
|
||||
java.util.NoSuchElementException: next on empty iterator
|
@ -1,62 +0,0 @@
|
||||
file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/Auth.java
|
||||
### java.util.NoSuchElementException: next on empty iterator
|
||||
|
||||
occurred in the presentation compiler.
|
||||
|
||||
presentation compiler configuration:
|
||||
Scala version: 3.3.3
|
||||
Classpath:
|
||||
<HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.3/scala3-library_3-3.3.3.jar [exists ], <HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar [exists ]
|
||||
Options:
|
||||
|
||||
|
||||
|
||||
action parameters:
|
||||
uri: file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/Auth.java
|
||||
text:
|
||||
```scala
|
||||
package fr.la_banquise.backend;
|
||||
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
|
||||
/**
|
||||
* Auth
|
||||
*/
|
||||
@Path("/user")
|
||||
public class Auth {
|
||||
|
||||
@GET
|
||||
@RolesAllowed("user")
|
||||
public Response hello() {
|
||||
return Response.ok("Hello from Quarkus!").build();
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Error stacktrace:
|
||||
|
||||
```
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:973)
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:971)
|
||||
scala.collection.mutable.MutationTracker$CheckedIterator.next(MutationTracker.scala:76)
|
||||
scala.collection.IterableOps.head(Iterable.scala:222)
|
||||
scala.collection.IterableOps.head$(Iterable.scala:222)
|
||||
scala.collection.AbstractIterable.head(Iterable.scala:933)
|
||||
dotty.tools.dotc.interactive.InteractiveDriver.run(InteractiveDriver.scala:168)
|
||||
scala.meta.internal.pc.MetalsDriver.run(MetalsDriver.scala:45)
|
||||
scala.meta.internal.pc.PcCollector.<init>(PcCollector.scala:44)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider$Collector$.<init>(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector$lzyINIT1(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.provide(PcSemanticTokensProvider.scala:90)
|
||||
scala.meta.internal.pc.ScalaPresentationCompiler.semanticTokens$$anonfun$1(ScalaPresentationCompiler.scala:110)
|
||||
```
|
||||
#### Short summary:
|
||||
|
||||
java.util.NoSuchElementException: next on empty iterator
|
@ -1,81 +0,0 @@
|
||||
file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/data/model/TpModel.java
|
||||
### java.util.NoSuchElementException: next on empty iterator
|
||||
|
||||
occurred in the presentation compiler.
|
||||
|
||||
presentation compiler configuration:
|
||||
Scala version: 3.3.3
|
||||
Classpath:
|
||||
<HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.3/scala3-library_3-3.3.3.jar [exists ], <HOME>/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.12/scala-library-2.13.12.jar [exists ]
|
||||
Options:
|
||||
|
||||
|
||||
|
||||
action parameters:
|
||||
uri: file://<WORKSPACE>/src/main/java/fr/la_banquise/backend/data/model/TpModel.java
|
||||
text:
|
||||
```scala
|
||||
package fr.la_banquise.backend.data.model;
|
||||
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
/**
|
||||
* TpModel
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "tps")
|
||||
public class TpModel {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
public Long id;
|
||||
public String name;
|
||||
public String description;
|
||||
|
||||
public String pdfLink;
|
||||
public String givenLink;
|
||||
public String respo;
|
||||
public String endDate;
|
||||
|
||||
public TpModel(String name, String description, String pdfLink, String givenLink, String respo, String endDate) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.pdfLink = pdfLink;
|
||||
this.givenLink = givenLink;
|
||||
this.respo = respo;
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public TpModel() {
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Error stacktrace:
|
||||
|
||||
```
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:973)
|
||||
scala.collection.Iterator$$anon$19.next(Iterator.scala:971)
|
||||
scala.collection.mutable.MutationTracker$CheckedIterator.next(MutationTracker.scala:76)
|
||||
scala.collection.IterableOps.head(Iterable.scala:222)
|
||||
scala.collection.IterableOps.head$(Iterable.scala:222)
|
||||
scala.collection.AbstractIterable.head(Iterable.scala:933)
|
||||
dotty.tools.dotc.interactive.InteractiveDriver.run(InteractiveDriver.scala:168)
|
||||
scala.meta.internal.pc.MetalsDriver.run(MetalsDriver.scala:45)
|
||||
scala.meta.internal.pc.PcCollector.<init>(PcCollector.scala:44)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider$Collector$.<init>(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector$lzyINIT1(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.Collector(PcSemanticTokensProvider.scala:61)
|
||||
scala.meta.internal.pc.PcSemanticTokensProvider.provide(PcSemanticTokensProvider.scala:90)
|
||||
scala.meta.internal.pc.ScalaPresentationCompiler.semanticTokens$$anonfun$1(ScalaPresentationCompiler.scala:110)
|
||||
```
|
||||
#### Short summary:
|
||||
|
||||
java.util.NoSuchElementException: next on empty iterator
|
15778
.metals/metals.log
15778
.metals/metals.log
File diff suppressed because it is too large
Load Diff
Binary file not shown.
14
pom.xml
14
pom.xml
@ -7,7 +7,7 @@
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<properties>
|
||||
<compiler-plugin.version>3.13.0</compiler-plugin.version>
|
||||
<maven.compiler.release>17</maven.compiler.release>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
|
||||
@ -65,6 +65,10 @@
|
||||
<artifactId>quarkus-quinoa</artifactId>
|
||||
<version>2.4.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-security-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-junit5</artifactId>
|
||||
@ -76,10 +80,10 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.22</version>
|
||||
<scope>provided</scope>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.36</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
@ -2,7 +2,6 @@ package fr.la_banquise.backend.data.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
|
||||
import io.quarkus.hibernate.orm.panache.PanacheEntity;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
|
@ -4,6 +4,10 @@ import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonManagedReference;
|
||||
|
||||
import io.quarkus.security.jpa.Password;
|
||||
import io.quarkus.security.jpa.Roles;
|
||||
import io.quarkus.security.jpa.UserDefinition;
|
||||
import io.quarkus.security.jpa.Username;
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
@ -26,19 +30,27 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@UserDefinition
|
||||
public class User {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@SequenceGenerator(name = "UserSeq", sequenceName = "user_id_seq", allocationSize = 1, initialValue = 1)
|
||||
public Long id;
|
||||
@Username
|
||||
public String name;
|
||||
@Password
|
||||
public String password;
|
||||
@Roles
|
||||
public String role;
|
||||
|
||||
@JsonManagedReference
|
||||
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
|
||||
public List<Instance> instances;
|
||||
|
||||
public User(String name, List<Instance> instances) {
|
||||
public User(String name, String password, String role, List<Instance> instances) {
|
||||
this.name = name;
|
||||
this.password = password;
|
||||
this.role = role;
|
||||
this.instances = instances;
|
||||
}
|
||||
|
||||
|
@ -9,5 +9,4 @@ import jakarta.enterprise.context.ApplicationScoped;
|
||||
*/
|
||||
@ApplicationScoped
|
||||
public class TpRepository implements PanacheRepository<Tp> {
|
||||
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ import jakarta.ws.rs.core.Response;
|
||||
* TpEndpoints
|
||||
*/
|
||||
@Path("/api/tps")
|
||||
@RolesAllowed("pingouin")
|
||||
public class TpEndpoints {
|
||||
|
||||
@Inject
|
||||
|
@ -1,12 +1,16 @@
|
||||
package fr.la_banquise.backend.rest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import fr.la_banquise.backend.rest.request.BulkUserRequest;
|
||||
import fr.la_banquise.backend.rest.request.DeleteUsersRequest;
|
||||
import fr.la_banquise.backend.rest.request.UserRequest;
|
||||
import fr.la_banquise.backend.rest.response.LoggedUserResponse;
|
||||
import fr.la_banquise.backend.services.UserService;
|
||||
import io.quarkus.security.identity.SecurityIdentity;
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.DELETE;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
@ -36,22 +40,22 @@ public class UserEndpoints {
|
||||
}
|
||||
|
||||
@GET
|
||||
@RolesAllowed("pingouin")
|
||||
@RolesAllowed("root")
|
||||
public Response getAllUsers() {
|
||||
return Response.ok(userService.getAllUsers()).build();
|
||||
}
|
||||
|
||||
@GET
|
||||
@RolesAllowed("pingouin")
|
||||
@RolesAllowed("root")
|
||||
@Path("{id}")
|
||||
public Response getUser(@PathParam("id") Long id) {
|
||||
return Response.ok(userService.getUser(id)).build();
|
||||
}
|
||||
|
||||
@POST
|
||||
@RolesAllowed("admin")
|
||||
@RolesAllowed("root")
|
||||
public Response createUser(UserRequest user) {
|
||||
return Response.ok(userService.createUser(user.name)).build();
|
||||
return Response.ok(userService.createUser(user)).build();
|
||||
}
|
||||
|
||||
@POST
|
||||
@ -61,4 +65,19 @@ public class UserEndpoints {
|
||||
userService.createJdmiUser(users);
|
||||
return Response.ok().build();
|
||||
}
|
||||
|
||||
@DELETE
|
||||
@RolesAllowed("root")
|
||||
public Response deleteJDMI() {
|
||||
userService.deleteJDMI();
|
||||
return Response.ok().build();
|
||||
}
|
||||
|
||||
@DELETE
|
||||
@RolesAllowed("root")
|
||||
@Path("/{id}")
|
||||
public Response deleteUser(@PathParam("id") Long id) {
|
||||
userService.deleteUser(id);
|
||||
return Response.ok().build();
|
||||
}
|
||||
}
|
||||
|
@ -7,5 +7,6 @@ import java.util.List;
|
||||
*/
|
||||
public class BulkUserRequest {
|
||||
public List<UserRequest> users;
|
||||
public String password;
|
||||
public Long tpId;
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
package fr.la_banquise.backend.rest.request;
|
||||
|
||||
public class DeleteUsersRequest {
|
||||
public Long[] ids;
|
||||
}
|
@ -62,6 +62,17 @@ public class InstanceService {
|
||||
return instanceRepository.deleteById(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean deleteAllInstances() {
|
||||
instanceRepository.deleteAll();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteJDMIInstances() {
|
||||
instanceRepository.deleteAll();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Instance updateInstance(Long id) {
|
||||
Instance instance = instanceRepository.findById(id);
|
||||
|
@ -3,10 +3,14 @@ package fr.la_banquise.backend.services;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.annotations.TypeRegistration;
|
||||
|
||||
import fr.la_banquise.backend.data.model.Instance;
|
||||
import fr.la_banquise.backend.data.model.User;
|
||||
import fr.la_banquise.backend.data.repository.UserRepository;
|
||||
import fr.la_banquise.backend.rest.request.BulkUserRequest;
|
||||
import fr.la_banquise.backend.rest.request.UserRequest;
|
||||
import io.quarkus.elytron.security.common.BcryptUtil;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.transaction.Transactional;
|
||||
@ -32,8 +36,8 @@ public class UserService {
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public User createUser(String name) {
|
||||
User user = new User(name, new ArrayList<>());
|
||||
public User createUser(UserRequest request) {
|
||||
User user = new User(request.name, BcryptUtil.bcryptHash(request.password), "pingouin", new ArrayList<>());
|
||||
userRepository.persist(user);
|
||||
return user;
|
||||
}
|
||||
@ -49,11 +53,26 @@ public class UserService {
|
||||
return user;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteUsers(Long[] ids) {
|
||||
for (Long id : ids) {
|
||||
userRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteJDMI() {
|
||||
for (Instance instance : instanceService.getAllInstances()) {
|
||||
instanceService.deleteInstance(instance.id);
|
||||
userRepository.deleteById(instance.user.id);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<User> createJdmiUser(BulkUserRequest usersRequest) {
|
||||
List<User> users = new ArrayList<>();
|
||||
for (UserRequest user : usersRequest.users) {
|
||||
User newUser = createUser(user.name);
|
||||
User newUser = createUser(user);
|
||||
users.add(newUser);
|
||||
instanceService.createInstance(user.instance_name, user.instance_ssh, user.instance_pwd, user.instance_port,
|
||||
user.name,
|
||||
|
@ -1,10 +0,0 @@
|
||||
package fr.la_banquise.backend.utils;
|
||||
|
||||
/**
|
||||
* Ldap
|
||||
*/
|
||||
public class Ldap {
|
||||
public String getBearer() {
|
||||
return "";
|
||||
}
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
package fr.la_banquise.backend.utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import io.vertx.core.json.JsonObject;
|
||||
|
||||
/**
|
||||
* RequestsHttp
|
||||
*/
|
||||
public class RequestsHttp {
|
||||
public static String call(String url, String body) {
|
||||
HttpClient client = HttpClient.newHttpClient();
|
||||
HttpRequest request = HttpRequest.newBuilder()
|
||||
.uri(URI.create(url))
|
||||
.POST(HttpRequest.BodyPublishers.ofString(body))
|
||||
.header("Content-Type", "application/json")
|
||||
.build();
|
||||
HttpResponse<String> response;
|
||||
try {
|
||||
response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
return response.body();
|
||||
} catch (IOException | InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static HttpResponse<String> callLdap(String url, String body) {
|
||||
String responseBearer = call("http://localhost:17170/auth/simple/login",
|
||||
"{\"username\": \"ldap_ro\", \"password\": \"qwertyuiop\"}");
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
String bearer = "";
|
||||
try {
|
||||
System.out.println(responseBearer);
|
||||
JsonNode jsonNode = objectMapper.readTree(responseBearer);
|
||||
bearer = jsonNode.get("token").asText();
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// TODO store jwt in db + refresh token and handle that later on
|
||||
|
||||
HttpClient client = HttpClient.newHttpClient();
|
||||
HttpRequest request = HttpRequest.newBuilder()
|
||||
.uri(URI.create(url))
|
||||
.POST(HttpRequest.BodyPublishers.ofString(body))
|
||||
.header("Content-Type", "application/json")
|
||||
.header("Authorization",
|
||||
"Bearer " + bearer)
|
||||
.build();
|
||||
HttpResponse<String> response;
|
||||
try {
|
||||
response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
return response;
|
||||
} catch (IOException | InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
quarkus.security.ldap.enabled=true
|
||||
quarkus.security.ldap.enabled=false
|
||||
quarkus.http.auth.form.enabled=true
|
||||
quarkus.http.auth.basic=true
|
||||
quarkus.http.auth.session.encryption-key=DC0wK2TMAwQdK2A88RSJ9j7Iae3wxy2RAjPgoCL6sOLnLpV4MhOY9leRldkkgepw
|
||||
@ -11,6 +11,10 @@ quarkus.http.auth.form.landing-page=
|
||||
quarkus.http.auth.form.login-page=
|
||||
quarkus.http.auth.form.error-page=
|
||||
|
||||
quarkus.http.auth.form.cookie-max-age=P30D
|
||||
quarkus.http.auth.form.timeout=P30D
|
||||
quarkus.http.auth.form.new-cookie-interval=P30D
|
||||
|
||||
quarkus.security.ldap.identity-mapping.rdn-identifier=uid
|
||||
quarkus.security.ldap.identity-mapping.search-base-dn=ou=people,dc=example,dc=com
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit de26f9f69dcce2b0b082f87d1954276de67da483
|
||||
Subproject commit 6f9f4d8121f784934626893f0550045d96ff4d19
|
Loading…
x
Reference in New Issue
Block a user