Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#323 - update to minos-*@0.5 #324

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions microservices/authentication/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ service:
injections:
lock_pool: minos.common.PostgreSqlLockPool
postgresql_pool: minos.common.PostgreSqlPool
broker_publisher: minos.networks.PostgreSqlQueuedKafkaBrokerPublisher
broker_subscriber_builder: minos.networks.PostgreSqlQueuedKafkaBrokerSubscriberBuilder
broker_publisher: minos.plugins.kafka.InMemoryQueuedKafkaBrokerPublisher
broker_subscriber_builder: minos.plugins.kafka.InMemoryQueuedKafkaBrokerSubscriberBuilder
broker_pool: minos.networks.BrokerClientPool
transaction_repository: minos.aggregate.PostgreSqlTransactionRepository
event_repository: minos.aggregate.PostgreSqlEventRepository
Expand Down Expand Up @@ -55,6 +55,6 @@ saga:
storage:
path: "./auth.lmdb"
discovery:
client: minos.networks.MinosDiscoveryClient
client: minos.plugins.minos_discovery.MinosDiscoveryClient
host: localhost
port: 5567
94 changes: 63 additions & 31 deletions microservices/authentication/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions microservices/authentication/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ packages = [{ include = "src" }]

[tool.poetry.dependencies]
python = "^3.9"
minos-microservice-common = "^0.4.0"
minos-microservice-networks = "^0.4.0"
minos-microservice-aggregate = "^0.4.0"
minos-microservice-saga = "^0.4.0"
minos-microservice-cqrs = "^0.4.0"
minos-microservice-common = "^0.5.0"
minos-microservice-networks = "^0.5.0"
minos-microservice-aggregate = "^0.5.0"
minos-microservice-saga = "^0.5.0"
minos-microservice-cqrs = "^0.5.0"
minos-broker-kafka = "^0.5.0"
minos-discovery-minos = "^0.5.0"
typer = "^0.3.2"
PyJWT = "^2.1.0"
SQLAlchemy = "1.4.22"
Expand Down
16 changes: 8 additions & 8 deletions microservices/authentication/src/aggregates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
)

from minos.aggregate import (
Aggregate,
AggregateRef,
Condition,
ModelRef,
ExternalEntity,
Ref,
RootEntity,
)


class Credentials(Aggregate):
"""Credentials Aggregate class.
class Credentials(RootEntity):
"""Credentials RootEntity class.

The purpose of this aggregate is to store the needed information to be authenticated.
"""

username: str
password: str
active: bool
user: ModelRef[Customer]
user: Ref[Customer]

@classmethod
async def exists_username(cls, username: str) -> bool:
Expand All @@ -35,5 +35,5 @@ async def exists_username(cls, username: str) -> bool:
return False


class Customer(AggregateRef):
"""Customer Aggregate-Reference class."""
class Customer(ExternalEntity):
"""Customer ExternalEntity class."""
2 changes: 1 addition & 1 deletion microservices/authentication/src/commands/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async def delete_credentials(self, request: Request) -> None:
async def user_deleted(self, request: Request) -> None:
"""Delete the associated credentials to the already deleted user.

:param request: A ``Request`` containing a ``AggregateDiff`` instance.
:param request: A ``Request`` containing a ``Event`` instance.
:return: This method does not return anything.
"""

Expand Down
6 changes: 3 additions & 3 deletions microservices/authentication/src/queries/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
InvalidTokenError,
)
from minos.aggregate import (
AggregateDiff,
Event,
)
from minos.cqrs import (
QueryService,
Expand Down Expand Up @@ -124,8 +124,8 @@ async def unique_username(self, request: Request) -> Response:
async def credentials_created(self, request: Request) -> None:
"""Handle the ``CredentialsCreated`` domain event.

:param request: A ``Request`` instance containing the ``AggregateDiff``.
:param request: A ``Request`` instance containing the ``Event``.
:return: This method does not return anything.
"""
diff: AggregateDiff = await request.content()
diff: Event = await request.content()
await self.repository.create_credentials(diff.uuid, diff.username, diff.password, diff.active, diff.user)
6 changes: 3 additions & 3 deletions microservices/cart/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ service:
injections:
lock_pool: minos.common.PostgreSqlLockPool
postgresql_pool: minos.common.PostgreSqlPool
broker_publisher: minos.networks.PostgreSqlQueuedKafkaBrokerPublisher
broker_subscriber_builder: minos.networks.PostgreSqlQueuedKafkaBrokerSubscriberBuilder
broker_publisher: minos.plugins.kafka.InMemoryQueuedKafkaBrokerPublisher
broker_subscriber_builder: minos.plugins.kafka.InMemoryQueuedKafkaBrokerSubscriberBuilder
broker_pool: minos.networks.BrokerClientPool
transaction_repository: minos.aggregate.PostgreSqlTransactionRepository
event_repository: minos.aggregate.PostgreSqlEventRepository
Expand Down Expand Up @@ -55,6 +55,6 @@ saga:
storage:
path: "./cart.lmdb"
discovery:
client: minos.networks.MinosDiscoveryClient
client: minos.plugins.minos_discovery.MinosDiscoveryClient
host: localhost
port: 5567
Loading