Skip to content

Commit c240bb8

Browse files
committed
Deprecate notification added
1 parent 248f2be commit c240bb8

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

kepconfig/ua_gateway/certificates.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,20 @@
1212
from ..error import KepHTTPError
1313
from ..ua_gateway.common import _INTER_TYPE, _create_url_cert, INSTANCE_CERTIFICATE
1414

15+
import warnings
16+
from ..helpers.deprecation_utils import _deprecated
17+
18+
19+
# Enable DeprecationWarnings to be visible
20+
warnings.simplefilter('always', DeprecationWarning)
21+
22+
@_deprecated("This function is deprecated and will be removed in a future release. Use `get_instance_certificate()` in UAG client or server module instead.")
1523
def get_instance_certificate(server: server) -> dict:
16-
'''Returns the properties of the UAG instance certificate object in the UAG certificate store.
24+
'''
25+
DEPRECATED: This function is deprecated and will be removed in a future release. Use `get_instance_certificate()`
26+
in UAG client or server module instead for Kepware 6.18+.
27+
28+
Returns the properties of the UAG instance certificate object in the UAG certificate store.
1729
These are UAG instance certificates that are used by UAG for trust purposes in the UA security model.
1830
1931
:param server: instance of the `server` class
@@ -26,25 +38,13 @@ def get_instance_certificate(server: server) -> dict:
2638
r = server._config_get(server.url + _create_url_cert(_INTER_TYPE.CERTS, INSTANCE_CERTIFICATE))
2739
return r.payload
2840

29-
# def get_all_certificates(server: server, *, options: dict = None) -> list:
30-
# TODO: Implement if/when multiple instance certificates can be configured.
31-
# '''Returns list of all UAG instance certificate objects and their properties in the UAG certificate store.
32-
# These are UAG instance certificates that are used by UAG for trust purposes in the UA security model.
33-
34-
# :param server: instance of the `server` class
35-
# :param options: *(optional)* Dict of parameters to filter, sort or pagenate the list of certificates. Options are `filter`,
36-
# `sortOrder`, `sortProperty`, `pageNumber`, and `pageSize`
37-
38-
# :return: List of data for all certificates in Kepware server UAG server endpoint certificate store
39-
40-
# :raises KepHTTPError: If urllib provides an HTTPError
41-
# :raises KepURLError: If urllib provides an URLError
42-
# '''
43-
# r = server._config_get(server.url + _create_url_cert(_INTER_TYPE.CERTS), params= options)
44-
# return r.payload
45-
41+
@_deprecated("This function is deprecated and will be removed in a future release. Use `TBD` instead.")
4642
def reissue_self_signed_instance_certificate(server: server) -> bool:
47-
'''Deletes and reissues a self-signed UAG instance certificate object in the UAG certificate store.
43+
'''
44+
DEPRECATED: This function is deprecated and will be removed in a future release. Use `get_instance_certificate()`
45+
in UAG client or server module instead for Kepware 6.18+.
46+
47+
Deletes and reissues a self-signed UAG instance certificate object in the UAG certificate store.
4848
This is the UAG instance certificate that are used by UAG for trust purposes in the UA security model.
4949
5050
:param server: instance of the `server` class

0 commit comments

Comments
 (0)