Skip to content

Commit 66d42fc

Browse files
committed
Add support for public private key from admin apis
1 parent 1f058f9 commit 66d42fc

File tree

5 files changed

+118
-0
lines changed

5 files changed

+118
-0
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ clean:
1111
rm -rf build
1212
test:
1313
cd server && go clean --testcache && go test -v ./test
14+
generate:
15+
cd server && go get github.com/99designs/gqlgen/[email protected] && go run github.com/99designs/gqlgen generate

server/graph/generated/generated.go

Lines changed: 104 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/graph/model/models_gen.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/graph/schema.graphqls

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ type Env {
9797
SENDER_EMAIL: String
9898
JWT_TYPE: String
9999
JWT_SECRET: String
100+
JWT_PRIVATE_KEY: String
101+
JWT_PUBLIC_KEY: String
100102
ALLOWED_ORIGINS: [String!]
101103
APP_URL: String
102104
REDIS_URL: String
@@ -131,6 +133,8 @@ input UpdateEnvInput {
131133
SENDER_EMAIL: String
132134
JWT_TYPE: String
133135
JWT_SECRET: String
136+
JWT_PRIVATE_KEY: String
137+
JWT_PUBLIC_KEY: String
134138
ALLOWED_ORIGINS: [String!]
135139
APP_URL: String
136140
REDIS_URL: String

server/resolvers/env.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ func EnvResolver(ctx context.Context) (*model.Env, error) {
4040
jwtType := store.StringEnv[constants.EnvKeyJwtType]
4141
jwtSecret := store.StringEnv[constants.EnvKeyJwtSecret]
4242
jwtRoleClaim := store.StringEnv[constants.EnvKeyJwtRoleClaim]
43+
jwtPublicKey := store.StringEnv[constants.EnvKeyJwtPublicKey]
44+
jwtPrivateKey := store.StringEnv[constants.EnvKeyJwtPrivateKey]
4345
allowedOrigins := store.SliceEnv[constants.EnvKeyAllowedOrigins]
4446
appURL := store.StringEnv[constants.EnvKeyAppURL]
4547
redisURL := store.StringEnv[constants.EnvKeyRedisURL]
@@ -74,6 +76,8 @@ func EnvResolver(ctx context.Context) (*model.Env, error) {
7476
SenderEmail: &senderEmail,
7577
JwtType: &jwtType,
7678
JwtSecret: &jwtSecret,
79+
JwtPrivateKey: &jwtPrivateKey,
80+
JwtPublicKey: &jwtPublicKey,
7781
JwtRoleClaim: &jwtRoleClaim,
7882
AllowedOrigins: allowedOrigins,
7983
AppURL: &appURL,

0 commit comments

Comments
 (0)