Skip to content
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
3 changes: 0 additions & 3 deletions api/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"ivpn.net/email/api/internal/repository"
"ivpn.net/email/api/internal/service"
"ivpn.net/email/api/internal/transport/api"
"ivpn.net/email/api/internal/utils"
)

func Run() error {
Expand All @@ -17,8 +16,6 @@ func Run() error {
return err
}

utils.NewLogger(cfg.API)

db, err := repository.NewDB(cfg.DB)
if err != nil {
return err
Expand Down
139 changes: 115 additions & 24 deletions api/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,46 @@ const docTemplate = `{
}
}
},
"/rotatepasession": {
"put": {
"description": "Rotate pre-auth session ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"subscription"
],
"summary": "Rotate pre-auth session ID",
"parameters": [
{
"description": "Rotate pre-auth session request",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.RotatePASessionReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.SuccessRes"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.ErrorRes"
}
}
}
}
},
"/settings": {
"get": {
"security": [
Expand Down Expand Up @@ -1033,6 +1073,51 @@ const docTemplate = `{
}
}
},
"/sub/session": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Add pre-auth session",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"subscription"
],
"summary": "Add pre-auth session",
"parameters": [
{
"description": "Pre-auth session request",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.PASessionReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/api.SuccessRes"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.ErrorRes"
}
}
}
}
},
"/subscription/update": {
"put": {
"security": [
Expand Down Expand Up @@ -1715,6 +1800,25 @@ const docTemplate = `{
}
}
},
"api.PASessionReq": {
"type": "object",
"required": [
"id",
"preauth_id",
"token"
],
"properties": {
"id": {
"type": "string"
},
"preauth_id": {
"type": "string"
},
"token": {
"type": "string"
}
}
},
"api.RecipientReq": {
"type": "object",
"required": [
Expand Down Expand Up @@ -1749,6 +1853,17 @@ const docTemplate = `{
}
}
},
"api.RotatePASessionReq": {
"type": "object",
"required": [
"sessionid"
],
"properties": {
"sessionid": {
"type": "string"
}
}
},
"api.SettingsReq": {
"type": "object",
"required": [
Expand Down Expand Up @@ -1776,20 +1891,12 @@ const docTemplate = `{
"type": "object",
"required": [
"email",
"preauthid",
"preauthtokenhash",
"subid"
],
"properties": {
"email": {
"type": "string"
},
"preauthid": {
"type": "string"
},
"preauthtokenhash": {
"type": "string"
},
"subid": {
"type": "string"
}
Expand All @@ -1799,8 +1906,6 @@ const docTemplate = `{
"type": "object",
"required": [
"email",
"preauthid",
"preauthtokenhash",
"subid"
],
"properties": {
Expand All @@ -1810,12 +1915,6 @@ const docTemplate = `{
"password": {
"type": "string"
},
"preauthid": {
"type": "string"
},
"preauthtokenhash": {
"type": "string"
},
"subid": {
"type": "string"
}
Expand All @@ -1825,20 +1924,12 @@ const docTemplate = `{
"type": "object",
"required": [
"id",
"preauthid",
"preauthtokenhash",
"subid"
],
"properties": {
"id": {
"type": "string"
},
"preauthid": {
"type": "string"
},
"preauthtokenhash": {
"type": "string"
},
"subid": {
"type": "string"
}
Expand Down
Loading