Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
haskell-gargantext
Commits
8094cd18
Commit
8094cd18
authored
Mar 19, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Garg Version api.
parent
dbb1ec70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
API.hs
src/Gargantext/API.hs
+21
-10
No files found.
src/Gargantext/API.hs
View file @
8094cd18
...
@@ -199,19 +199,25 @@ type GargAPI = "api" :> Summary "API " :> GargAPIVersion
...
@@ -199,19 +199,25 @@ type GargAPI = "api" :> Summary "API " :> GargAPIVersion
-- | TODO :<|> Summary "Latest API" :> GargAPI'
-- | TODO :<|> Summary "Latest API" :> GargAPI'
type
GargAPIVersion
=
"v1.0"
:>
Summary
"v1.0: "
:>
GargAPI'
type
GargAPIVersion
=
"v1.0"
:>
Summary
"Garg API Version "
:>
GargAPI'
type
GargVersion
=
"version"
:>
Summary
"Backend version"
:>
Get
'[
J
SON
]
Text
type
GargAPI'
=
type
GargAPI'
=
-- Auth endpoint
-- Auth endpoint
"auth"
:>
Summary
"AUTH API"
"auth"
:>
Summary
"AUTH API"
:>
ReqBody
'[
J
SON
]
AuthRequest
:>
ReqBody
'[
J
SON
]
AuthRequest
:>
Post
'[
J
SON
]
AuthResponse
:>
Post
'[
J
SON
]
AuthResponse
:<|>
"version"
:>
Summary
"Backend version"
:<|>
GargVersion
:>
Get
'[
J
SON
]
Text
-- TODO-ACCESS here we want to request a particular header for
-- TODO-ACCESS here we want to request a particular header for
-- auth and capabilities.
-- auth and capabilities.
:<|>
GargPrivateAPI
:<|>
GargPrivateAPI
type
GargPrivateAPI
=
SA
.
Auth
'[
S
A
.
JWT
,
SA
.
Cookie
]
AuthenticatedUser
:>
GargPrivateAPI'
type
GargPrivateAPI
=
SA
.
Auth
'[
S
A
.
JWT
,
SA
.
Cookie
]
AuthenticatedUser
:>
GargPrivateAPI'
type
GargAdminAPI
type
GargAdminAPI
...
@@ -341,7 +347,11 @@ server :: forall env. EnvC env => env -> IO (Server API)
...
@@ -341,7 +347,11 @@ server :: forall env. EnvC env => env -> IO (Server API)
server
env
=
do
server
env
=
do
-- orchestrator <- scrapyOrchestrator env
-- orchestrator <- scrapyOrchestrator env
pure
$
schemaUiServer
swaggerDoc
pure
$
schemaUiServer
swaggerDoc
:<|>
hoistServerWithContext
(
Proxy
::
Proxy
GargAPI
)
(
Proxy
::
Proxy
AuthContext
)
transform
serverGargAPI
:<|>
hoistServerWithContext
(
Proxy
::
Proxy
GargAPI
)
(
Proxy
::
Proxy
AuthContext
)
transform
serverGargAPI
:<|>
frontEndServer
:<|>
frontEndServer
where
where
transform
::
forall
a
.
GargServerM
env
GargError
a
->
Handler
a
transform
::
forall
a
.
GargServerM
env
GargError
a
->
Handler
a
...
@@ -353,13 +363,14 @@ serverGargAPI -- orchestrator
...
@@ -353,13 +363,14 @@ serverGargAPI -- orchestrator
:<|>
gargVersion
:<|>
gargVersion
:<|>
serverPrivateGargAPI
:<|>
serverPrivateGargAPI
-- :<|> orchestrator
-- :<|> orchestrator
where
gargVersion
::
GargServer
Text
gargVersion
::
GargServer
GargVersion
gargVersion
=
pure
$
(
showVersion
PG
.
version
::
Text
)
gargVersion
=
pure
(
cs
$
showVersion
PG
.
version
)
serverPrivateGargAPI
::
GargServerT
env
err
(
GargServerM
env
err
)
GargPrivateAPI
serverPrivateGargAPI
::
GargServerT
env
err
(
GargServerM
env
err
)
GargPrivateAPI
serverPrivateGargAPI
(
Authenticated
auser
)
=
serverPrivateGargAPI'
auser
serverPrivateGargAPI
(
Authenticated
auser
)
=
serverPrivateGargAPI'
auser
serverPrivateGargAPI
_
=
throwAll'
(
_ServerError
#
err401
)
serverPrivateGargAPI
_
=
throwAll'
(
_ServerError
#
err401
)
-- Here throwAll' requires a concrete type for the monad.
-- Here throwAll' requires a concrete type for the monad.
-- TODO-SECURITY admin only: withAdmin
-- TODO-SECURITY admin only: withAdmin
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment