This file contains hidden or 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
package tech.donau.quarkify.security; | |
import org.eclipse.microprofile.jwt.Claims; | |
import org.jose4j.jws.AlgorithmIdentifiers; | |
import org.jose4j.jws.JsonWebSignature; | |
import org.jose4j.jwt.JwtClaims; | |
import org.jose4j.jwt.NumericDate; | |
import java.io.InputStream; | |
import java.security.KeyFactory; |
This file contains hidden or 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
package net.quarkify; | |
import graphql.GraphQL; | |
import graphql.schema.*; | |
import graphql.schema.idl.*; | |
import io.vertx.core.Promise; | |
import io.vertx.ext.web.Router; | |
import io.vertx.ext.web.handler.graphql.*; | |
import net.quarkify.data.*; |
This file contains hidden or 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
private GraphQL createGraphQL() throws Exception { | |
TypeDefinitionRegistry teamsSchema = getTeamSchema(); | |
RuntimeWiring runtimeWiring = RuntimeWiring.newRuntimeWiring() | |
.type("Query", | |
builder -> builder.dataFetcher("allTeams", new VertxDataFetcher<>(this::getAllTeams)) | |
).build(); | |
SchemaGenerator schemaGenerator = new SchemaGenerator(); | |
GraphQLSchema graphQLSchema = schemaGenerator.makeExecutableSchema(teamsSchema, runtimeWiring); |
This file contains hidden or 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
package net.quarkify.data; | |
public class Team { | |
public Long id; | |
public String name; | |
public User[] users; | |
public Team(Long id, String name, User... users) { | |
this.id = id; | |
this.name = name; |
This file contains hidden or 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
package org.acme.getting.started.command; | |
import org.acme.getting.started.data.Setting; | |
import picocli.CommandLine; | |
import javax.enterprise.context.Dependent; | |
import javax.transaction.Transactional; | |
@Dependent | |
@CommandLine.Command(name = "set") | |
public class SetCommand implements Runnable { |
This file contains hidden or 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
package org.acme.getting.started.data; | |
import io.quarkus.hibernate.orm.panache.PanacheEntityBase; | |
import javax.persistence.*; | |
@Entity | |
public class Setting extends PanacheEntityBase { | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) | |
public Integer id; |
This file contains hidden or 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
package org.acme.getting.started; | |
import io.quarkus.runtime.*; | |
import io.quarkus.runtime.annotations.QuarkusMain; | |
import org.acme.getting.started.command.*; | |
import org.apache.maven.shared.utils.cli.CommandLineUtils; | |
import picocli.CommandLine; | |
import javax.inject.Inject; | |
@QuarkusMain |
This file contains hidden or 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
package org.acme.getting.started.command; | |
import org.acme.getting.started.GreetingService; | |
import picocli.CommandLine; | |
import javax.enterprise.context.Dependent; | |
import javax.inject.Inject; | |
@Dependent | |
@CommandLine.Command(name = "greet", mixinStandardHelpOptions = true, description = "Greet person by their name") | |
public class GreetingCommand implements Runnable { |
This file contains hidden or 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
package org.acme.getting.started.command; | |
import picocli.CommandLine; | |
@CommandLine.Command(subcommands = { | |
CommandLine.HelpCommand.class | |
// Put here more static commands, that don't require Dependency Injection | |
}) | |
public class QuarkusCommand { | |
} |
This file contains hidden or 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
package org.acme.getting.started; | |
import io.quarkus.runtime.Quarkus; | |
import io.quarkus.runtime.QuarkusApplication; | |
import io.quarkus.runtime.annotations.QuarkusMain; | |
import org.jboss.logging.Logger; | |
import javax.inject.Inject; | |
@QuarkusMain | |
public class GreetingApplication implements QuarkusApplication { |