Skip to content

Commit

Permalink
feat: config is not required when creating a new project
Browse files Browse the repository at this point in the history
  • Loading branch information
jirevwe committed Jun 11, 2022
1 parent 2dc5537 commit b6b7e78
Show file tree
Hide file tree
Showing 14 changed files with 217 additions and 165 deletions.
10 changes: 5 additions & 5 deletions datastore/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ type Group struct {
}

type GroupConfig struct {
RateLimit RateLimitConfiguration `json:"ratelimit"`
Strategy StrategyConfiguration `json:"strategy"`
Signature SignatureConfiguration `json:"signature"`
DisableEndpoint bool `json:"disable_endpoint" bson:"disable_endpoint"`
ReplayAttacks bool `json:"replay_attacks" bson:"replay_attacks"`
RateLimit *RateLimitConfiguration `json:"ratelimit"`
Strategy *StrategyConfiguration `json:"strategy"`
Signature *SignatureConfiguration `json:"signature"`
DisableEndpoint bool `json:"disable_endpoint" bson:"disable_endpoint"`
ReplayAttacks bool `json:"replay_attacks" bson:"replay_attacks"`
}

type RateLimitConfiguration struct {
Expand Down
9 changes: 5 additions & 4 deletions docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2022-06-10 11:08:30.465468456 +0100 WAT m=+80.799317685
// 2022-06-11 13:13:35.06004297 +0100 WAT m=+109.124216609
package docs

import (
Expand Down Expand Up @@ -7349,6 +7349,7 @@ var doc = `{
"type": "string"
},
"matched_endpoints": {
"description": "TODO(all) remove this field",
"type": "integer"
},
"provider_id": {
Expand Down Expand Up @@ -7384,12 +7385,12 @@ var doc = `{
"description": {
"type": "string"
},
"endpoint": {
"$ref": "#/definitions/datastore.Endpoint"
},
"endpoint_id": {
"type": "string"
},
"endpoint_metadata": {
"$ref": "#/definitions/datastore.Endpoint"
},
"event_id": {
"type": "string"
},
Expand Down
7 changes: 4 additions & 3 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -7337,6 +7337,7 @@
"type": "string"
},
"matched_endpoints": {
"description": "TODO(all) remove this field",
"type": "integer"
},
"provider_id": {
Expand Down Expand Up @@ -7372,12 +7373,12 @@
"description": {
"type": "string"
},
"endpoint": {
"$ref": "#/definitions/datastore.Endpoint"
},
"endpoint_id": {
"type": "string"
},
"endpoint_metadata": {
"$ref": "#/definitions/datastore.Endpoint"
},
"event_id": {
"type": "string"
},
Expand Down
5 changes: 3 additions & 2 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ definitions:
group_id:
type: string
matched_endpoints:
description: TODO(all) remove this field
type: integer
provider_id:
description: |-
Expand Down Expand Up @@ -193,10 +194,10 @@ definitions:
type: string
description:
type: string
endpoint:
$ref: '#/definitions/datastore.Endpoint'
endpoint_id:
type: string
endpoint_metadata:
$ref: '#/definitions/datastore.Endpoint'
event_id:
type: string
event_metadata:
Expand Down
85 changes: 55 additions & 30 deletions docs/v3/openapi3.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
"type": "string"
},
"matched_endpoints": {
"description": "TODO(all) remove this field",
"type": "integer"
},
"provider_id": {
Expand Down Expand Up @@ -284,12 +285,12 @@
"description": {
"type": "string"
},
"endpoint": {
"$ref": "#/components/schemas/datastore.Endpoint"
},
"endpoint_id": {
"type": "string"
},
"endpoint_metadata": {
"$ref": "#/components/schemas/datastore.Endpoint"
},
"event_id": {
"type": "string"
},
Expand Down Expand Up @@ -1060,14 +1061,6 @@
},
"type": "object"
},
"models.UserExists": {
"properties": {
"email": {
"type": "string"
}
},
"type": "object"
},
"server.Stub": {
"type": "object"
},
Expand Down Expand Up @@ -8612,21 +8605,20 @@
]
}
},
"/users/exists": {
"post": {
"description": "This endpoint checks if a user exists",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/models.UserExists"
}
"/users/token": {
"get": {
"description": "This endpoint finds a user by an invite token",
"parameters": [
{
"description": "invite token",
"in": "query",
"name": "token",
"required": true,
"schema": {
"type": "string"
}
},
"description": "User Exists Details",
"required": true,
"x-originalParamName": "group"
},
}
],
"responses": {
"200": {
"content": {
Expand All @@ -8639,7 +8631,7 @@
{
"properties": {
"data": {
"type": "boolean"
"$ref": "#/components/schemas/datastore.User"
}
},
"type": "object"
Expand Down Expand Up @@ -8722,15 +8714,26 @@
"ApiKeyAuth": []
}
],
"summary": "Checks If a user exists",
"summary": "Find user by invite token",
"tags": [
"User"
"Organisation"
]
}
},
"/users/password": {
"/users/{userID}/password": {
"put": {
"description": "This endpoint updates a user's password",
"parameters": [
{
"description": "user id",
"in": "path",
"name": "userID",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
Expand Down Expand Up @@ -8844,9 +8847,20 @@
]
}
},
"/users/profile": {
"/users/{userID}/profile": {
"get": {
"description": "This endpoint fetches a user",
"parameters": [
{
"description": "user id",
"in": "path",
"name": "userID",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
Expand Down Expand Up @@ -8949,6 +8963,17 @@
},
"put": {
"description": "This endpoint updates a user",
"parameters": [
{
"description": "user id",
"in": "path",
"name": "userID",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
Expand Down
Loading

0 comments on commit b6b7e78

Please sign in to comment.