Skip to content

Commit

Permalink
Merge branch 'master' into enhancement/auto-complete
Browse files Browse the repository at this point in the history
  • Loading branch information
wssheldon authored Oct 2, 2023
2 parents e3b4eb6 + d277d5b commit 5c0ce48
Show file tree
Hide file tree
Showing 48 changed files with 1,288 additions and 340 deletions.
3 changes: 2 additions & 1 deletion requirements-base.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ atlassian-python-api==3.32.0
attrs==22.1.0
bcrypt
blockkit
boto3
cachetools
chardet
click
Expand Down Expand Up @@ -44,8 +45,8 @@ schemathesis
sentry-asgi
sentry-sdk
sh
slack-bolt
slack_sdk
slack-bolt
slowapi
spacy
sqlalchemy-filters
Expand Down
14 changes: 7 additions & 7 deletions requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ email-validator==2.0.0.post2
# via -r requirements-base.in
emails==0.6
# via -r requirements-base.in
fastapi==0.103.1
fastapi==0.103.2
# via -r requirements-base.in
frozenlist==1.4.0
# via
# aiohttp
# aiosignal
google-api-core==2.11.1
# via google-api-python-client
google-api-python-client==2.100.0
google-api-python-client==2.101.0
# via -r requirements-base.in
google-auth==2.22.0
# via
Expand Down Expand Up @@ -207,7 +207,7 @@ markupsafe==2.1.3
# jinja2
# mako
# werkzeug
msal==1.24.0
msal==1.24.1
# via -r requirements-base.in
multidict==6.0.4
# via
Expand Down Expand Up @@ -235,7 +235,7 @@ oauthlib[signedtoken]==3.2.2
# atlassian-python-api
# jira
# requests-oauthlib
openai==0.28.0
openai==0.28.1
# via -r requirements-base.in
packaging==23.1
# via
Expand Down Expand Up @@ -272,7 +272,7 @@ protobuf==4.24.3
# -r requirements-base.in
# google-api-core
# googleapis-common-protos
psycopg2-binary==2.9.7
psycopg2-binary==2.9.8
# via -r requirements-base.in
pyasn1==0.5.0
# via
Expand All @@ -286,7 +286,7 @@ pyasn1-modules==0.3.0
# oauth2client
pycparser==2.21
# via cffi
pydantic==1.10.12
pydantic==1.10.13
# via
# -r requirements-base.in
# blockkit
Expand Down Expand Up @@ -358,7 +358,7 @@ rsa==4.9
# google-auth
# oauth2client
# python-jose
schedule==1.2.0
schedule==1.2.1
# via -r requirements-base.in
schemathesis==3.19.7
# via -r requirements-base.in
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ identify==2.5.27
# via pre-commit
iniconfig==2.0.0
# via pytest
ipython==8.15.0
ipython==8.16.1
# via -r requirements-dev.in
jedi==0.19.0
# via ipython
Expand Down Expand Up @@ -90,7 +90,7 @@ python-dateutil==2.8.2
# via faker
pyyaml==6.0.1
# via pre-commit
ruff==0.0.290
ruff==0.0.291
# via -r requirements-dev.in
six==1.16.0
# via
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ def run(self):
"dispatch.plugins": [
"dispatch_atlassian_confluence = dispatch.plugins.dispatch_atlassian_confluence.plugin:ConfluencePagePlugin",
"dispatch_atlassian_confluence_document = dispatch.plugins.dispatch_atlassian_confluence.docs.plugin:ConfluencePageDocPlugin",
"dispatch_aws_sqs = dispatch.plugins.dispatch_aws.plugin:AWSSQSSignalConsumerPlugin",
"dispatch_basic_auth = dispatch.plugins.dispatch_core.plugin:BasicAuthProviderPlugin",
"dispatch_contact = dispatch.plugins.dispatch_core.plugin:DispatchContactPlugin",
"dispatch_document_resolver = dispatch.plugins.dispatch_core.plugin:DispatchDocumentResolverPlugin",
Expand Down
4 changes: 4 additions & 0 deletions src/dispatch/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from dispatch.entity.views import router as entity_router
from dispatch.entity_type.views import router as entity_type_router
from dispatch.feedback.incident.views import router as feedback_router
from dispatch.feedback.service.views import router as service_feedback_router
from dispatch.incident.priority.views import router as incident_priority_router
from dispatch.incident.severity.views import router as incident_severity_router
from dispatch.incident.type.views import router as incident_type_router
Expand Down Expand Up @@ -203,6 +204,9 @@ def get_organization_path(organization: OrganizationSlug):
authenticated_organization_api_router.include_router(
feedback_router, prefix="/feedback", tags=["feedback"]
)
authenticated_organization_api_router.include_router(
service_feedback_router, prefix="/service_feedback", tags=["service_feedback"]
)
authenticated_organization_api_router.include_router(
notification_router, prefix="/notifications", tags=["notifications"]
)
Expand Down
3 changes: 3 additions & 0 deletions src/dispatch/auth/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class DispatchUser(Base, TimeStampMixin):
email = Column(String, unique=True)
password = Column(LargeBinary, nullable=False)
last_mfa_time = Column(DateTime, nullable=True)
experimental_features = Column(Boolean, default=False)

# relationships
events = relationship("Event", backref="dispatch_user")
Expand Down Expand Up @@ -157,13 +158,15 @@ class UserLoginResponse(DispatchBase):
class UserRead(UserBase):
id: PrimaryKey
role: Optional[str] = Field(None, nullable=True)
experimental_features: Optional[bool]


class UserUpdate(DispatchBase):
id: PrimaryKey
password: Optional[str] = Field(None, nullable=True)
projects: Optional[List[UserProject]]
organizations: Optional[List[UserOrganization]]
experimental_features: Optional[bool]
role: Optional[str] = Field(None, nullable=True)

@validator("password", pre=True)
Expand Down
3 changes: 3 additions & 0 deletions src/dispatch/auth/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ def update(*, db_session, user: DispatchUser, user_in: UserUpdate) -> DispatchUs
)
)

if experimental_features := user_in.experimental_features:
user.experimental_features = experimental_features

db_session.commit()
return user

Expand Down
Loading

0 comments on commit 5c0ce48

Please sign in to comment.