Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cake-bot
Overview
Overview
Details
Activity
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
Oleksandr Barabash
cake-bot
Commits
6386fc33
Commit
6386fc33
authored
Oct 24, 2022
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
json parser fixed
parent
bdfc343a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
app.py
app.py
+9
-6
No files found.
app.py
View file @
6386fc33
...
@@ -15,7 +15,7 @@ from botbuilder.core import (
...
@@ -15,7 +15,7 @@ from botbuilder.core import (
BotFrameworkAdapter
,
BotFrameworkAdapter
,
)
)
from
botbuilder.schema
import
Activity
,
ActivityTypes
from
botbuilder.schema
import
Activity
,
ActivityTypes
from
marshmallow
import
EXCLUDE
from
marshmallow
import
EXCLUDE
,
ValidationError
from
bots
import
TeamsMessagingExtensionsActionPreviewBot
from
bots
import
TeamsMessagingExtensionsActionPreviewBot
from
bots.exceptions
import
ConversationNotFound
,
DataParsingError
from
bots.exceptions
import
ConversationNotFound
,
DataParsingError
...
@@ -199,11 +199,14 @@ async def v1_auth(request: Request) -> Response:
...
@@ -199,11 +199,14 @@ async def v1_auth(request: Request) -> Response:
body
=
await
request
.
json
()
body
=
await
request
.
json
()
else
:
else
:
return
Response
(
status
=
HTTPStatus
.
UNSUPPORTED_MEDIA_TYPE
)
return
Response
(
status
=
HTTPStatus
.
UNSUPPORTED_MEDIA_TYPE
)
admin_user
=
AdminUser
.
Schema
()
.
load
(
body
)
try
:
if
admin_user
.
login
and
admin_user
.
password
:
admin_user
=
AdminUser
.
Schema
()
.
load
(
body
)
result
=
await
TOKEN_HELPER
.
do_auth
(
admin_user
)
if
admin_user
.
login
and
admin_user
.
password
:
if
result
is
not
None
:
result
=
await
TOKEN_HELPER
.
do_auth
(
admin_user
)
return
Response
(
status
=
HTTPStatus
.
OK
,
body
=
json_dumps
(
result
))
if
result
is
not
None
:
return
Response
(
status
=
HTTPStatus
.
OK
,
body
=
json_dumps
(
result
))
except
ValidationError
:
pass
return
Response
(
status
=
HTTPStatus
.
FORBIDDEN
)
return
Response
(
status
=
HTTPStatus
.
FORBIDDEN
)
...
...
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