From 36070555d1bd49aa1b25180db982a31dbac694a1 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 16 Feb 2011 13:07:13 +0100 Subject: Validate and convert certificate SN The cert plugin only worked OK with decimal certificate serial numbers. This patch allows specifying the serial number in hexadecimal, too. The conversion now works such that: * with no explicit radix, a best-effort conversion is done using int(str, 0) in python. If the format is ambiguous, decimal takes precedence. * a hexadecimal radix can be specified explicitly with the traditional 0x prefix https://fedorahosted.org/freeipa/ticket/958 https://fedorahosted.org/freeipa/ticket/953 --- API.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'API.txt') diff --git a/API.txt b/API.txt index 557a0e80..1f956ec7 100644 --- a/API.txt +++ b/API.txt @@ -303,7 +303,7 @@ output: Output('count', , Gettext('', domain='ipa', localedir=None)) output: Output('results', , Gettext('', domain='ipa', localedir=None)) command: cert_remove_hold args: 1,0,1 -arg: Str('serial_number', label=Gettext('Serial number', domain='ipa', localedir=None)) +arg: Str('serial_number', validate_serial_number, label=Gettext('Serial number', domain='ipa', localedir=None), normalizer=normalize_serial_number) output: Output('result', None, None) command: cert_request args: 1,3,1 @@ -314,12 +314,12 @@ option: Flag('add', autofill=True, default=False,lag('add', autofill=True, defau output: Output('result', , Gettext('Dictionary mapping variable name to value', domain='ipa', localedir=None)) command: cert_revoke args: 1,1,1 -arg: Str('serial_number', label=Gettext('Serial number', domain='ipa', localedir=None)) +arg: Str('serial_number', validate_serial_number, label=Gettext('Serial number', domain='ipa', localedir=None), normalizer=normalize_serial_number) option: Int('revocation_reason?', default=0, label=Gettext('Reason', domain='ipa', localedir=None), maxvalue=10, minvalue=0) output: Output('result', None, None) command: cert_show args: 1,1,1 -arg: Str('serial_number', label=Gettext('Serial number', domain='ipa', localedir=None)) +arg: Str('serial_number', validate_serial_number, label=Gettext('Serial number', domain='ipa', localedir=None), normalizer=normalize_serial_number) option: Str('out?', exclude='webui', label=Gettext('Output filename', domain='ipa', localedir=None)) output: Output('result', None, None) command: cert_status -- cgit