Skip to content

Commit

Permalink
ISSUE #323
Browse files Browse the repository at this point in the history
* Update to `minos-*@0.5.0`.
  • Loading branch information
Sergio García Prado committed Feb 3, 2022
1 parent 9e3cdcc commit a2d8139
Show file tree
Hide file tree
Showing 42 changed files with 1,000 additions and 616 deletions.
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
160 changes: 103 additions & 57 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 = { path = "../../../minos-python/packages/core/minos-microservice-common", develop = true }
minos-microservice-networks = { path = "../../../minos-python/packages/core/minos-microservice-networks", develop = true }
minos-microservice-aggregate = { path = "../../../minos-python/packages/core/minos-microservice-aggregate", develop = true }
minos-microservice-saga = { path = "../../../minos-python/packages/core/minos-microservice-saga", develop = true }
minos-microservice-cqrs = { path = "../../../minos-python/packages/core/minos-microservice-cqrs", develop = true }
minos-broker-kafka = { path = "../../../minos-python/packages/plugins/minos-broker-kafka", develop = true }
minos-discovery-minos = { path = "../../../minos-python/packages/plugins/minos-discovery-minos", develop = true }
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,
RootEntity,
ExternalEntity,
Condition,
ModelRef,
Ref,
)


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

0 comments on commit a2d8139

Please sign in to comment.