diff --git a/aries_cloudagent/config/logging.py b/aries_cloudagent/config/logging.py index 149d5456b5..adf3eeed43 100644 --- a/aries_cloudagent/config/logging.py +++ b/aries_cloudagent/config/logging.py @@ -327,15 +327,26 @@ def print_banner( @classmethod def print_notices(cls, settings: Settings): """Print notices and warnings.""" - if settings.get("wallet.type", "in_memory").lower() == "indy": - with Banner(border=":", length=80, file=sys.stderr) as banner: - banner.centered("⚠ DEPRECATION NOTICE: ⚠") - banner.hr() + with Banner(border=":", length=80, file=sys.stderr) as banner: + banner.centered("⚠ DEPRECATION NOTICE: ⚠") + banner.hr() + if settings.get("wallet.type", "in_memory").lower() == "indy": banner.print( "The Indy wallet type is deprecated, use Askar instead; see: " "https://aca-py.org/main/deploying/IndySDKtoAskarMigration/", ) - print() + banner.hr() + banner.print( + "Aries RFC 0160: Connection Protocol is deprecated and support will be " + "removed in a future version; use RFC 0023: DID Exchange instead." + ) + banner.hr() + banner.print( + "Using `did:sov:BzCbsNYhMrjHiqZDTUASHg;spec` in protocols is deprecated " + "and support will be removed in a future version; use " + "https://didcomm.org/ instead." + ) + print() ###################################################################### diff --git a/aries_cloudagent/core/dispatcher.py b/aries_cloudagent/core/dispatcher.py index b8660ab568..85ed3adcb3 100644 --- a/aries_cloudagent/core/dispatcher.py +++ b/aries_cloudagent/core/dispatcher.py @@ -286,6 +286,20 @@ async def make_message( if not message_type: raise MessageParseError("Message does not contain '@type' parameter") + + if message_type.startswith("did:sov"): + warnings.warn( + "Using `did:sov:BzCbsNYhMrjHiqZDTUASHg;spec` in protocols is deprecated " + "and support will be removed in a future version; use " + "https://didcomm.org/ instead.", + DeprecationWarning, + ) + self.logger.warning( + "Using `did:sov:BzCbsNYhMrjHiqZDTUASHg;spec` in protocols is deprecated " + "and support will be removed in a future version; use " + "https://didcomm.org/ instead.", + ) + message_type_rec_version = get_version_from_message_type(message_type) registry: ProtocolRegistry = self.profile.inject(ProtocolRegistry) diff --git a/aries_cloudagent/protocols/connections/v1_0/manager.py b/aries_cloudagent/protocols/connections/v1_0/manager.py index 700fd0f364..5b347f3427 100644 --- a/aries_cloudagent/protocols/connections/v1_0/manager.py +++ b/aries_cloudagent/protocols/connections/v1_0/manager.py @@ -2,6 +2,7 @@ import logging from typing import Optional, Sequence, Tuple, Union, cast +import warnings from ....connections.base_manager import BaseConnectionManager from ....connections.models.conn_record import ConnRecord @@ -52,6 +53,18 @@ def profile(self) -> Profile: """ return self._profile + def deprecation_warning(self): + """Log a deprecation warning.""" + warnings.warn( + "Aries RFC 0160: Connection Protocol is deprecated and support will be " + "removed in a future version; use RFC 0023: DID Exchange instead.", + DeprecationWarning, + ) + self._logger.warning( + "Aries RFC 0160: Connection Protocol is deprecated and support will be " + "removed in a future version; use RFC 0023: DID Exchange instead." + ) + async def create_invitation( self, my_label: Optional[str] = None, @@ -107,6 +120,7 @@ async def create_invitation( A tuple of the new `ConnRecord` and `ConnectionInvitation` instances """ + self.deprecation_warning() # Mediation Record can still be None after this operation if no # mediation id passed and no default mediation_record = await self._route_manager.mediation_record_if_id( @@ -257,6 +271,7 @@ async def receive_invitation( The new `ConnRecord` instance """ + self.deprecation_warning() if not invitation.did: if not invitation.recipient_keys: raise ConnectionManagerError( @@ -338,6 +353,7 @@ async def create_request( A new `ConnectionRequest` message to send to the other agent """ + self.deprecation_warning() mediation_records = await self._route_manager.mediation_records_for_connection( self.profile, @@ -411,6 +427,7 @@ async def receive_request( The new or updated `ConnRecord` instance """ + self.deprecation_warning() ConnRecord.log_state( "Receiving connection request", {"request": request}, @@ -575,6 +592,7 @@ async def create_response( A tuple of the updated `ConnRecord` new `ConnectionResponse` message """ + self.deprecation_warning() ConnRecord.log_state( "Creating connection response", {"connection_id": connection.connection_id}, @@ -686,6 +704,7 @@ async def accept_response( at the request or response stage """ + self.deprecation_warning() connection = None if response._thread: # identify the request by the thread ID @@ -765,6 +784,7 @@ async def receive_problem_report( report: ConnectionProblemReport, ): """Receive problem report.""" + self.deprecation_warning() if not report.description: raise ConnectionManagerError("Missing description in problem report") diff --git a/aries_cloudagent/protocols/connections/v1_0/routes.py b/aries_cloudagent/protocols/connections/v1_0/routes.py index ad0503efa7..4e6ff949ba 100644 --- a/aries_cloudagent/protocols/connections/v1_0/routes.py +++ b/aries_cloudagent/protocols/connections/v1_0/routes.py @@ -594,6 +594,7 @@ async def connections_metadata_set(request: web.BaseRequest): @docs( tags=["connection"], summary="Create a new connection invitation", + deprecated=True, ) @querystring_schema(CreateInvitationQueryStringSchema()) @request_schema(CreateInvitationRequestSchema()) @@ -667,6 +668,7 @@ async def connections_create_invitation(request: web.BaseRequest): @docs( tags=["connection"], summary="Receive a new connection invitation", + deprecated=True, ) @querystring_schema(ReceiveInvitationQueryStringSchema()) @request_schema(ReceiveInvitationRequestSchema()) @@ -708,6 +710,7 @@ async def connections_receive_invitation(request: web.BaseRequest): @docs( tags=["connection"], summary="Accept a stored connection invitation", + deprecated=True, ) @match_info_schema(ConnectionsConnIdMatchInfoSchema()) @querystring_schema(AcceptInvitationQueryStringSchema()) @@ -758,6 +761,7 @@ async def connections_accept_invitation(request: web.BaseRequest): @docs( tags=["connection"], summary="Accept a stored connection request", + deprecated=True, ) @match_info_schema(ConnectionsConnIdMatchInfoSchema()) @querystring_schema(AcceptRequestQueryStringSchema())