Implement the cert-find command for the dogtag CA backend.

Use a new RESTful API provided by dogtag 10+. Construct an XML document
representing the search request. The output is limited to whatever dogtag
sends us, there is no way to request additional attributes other than
to read each certificate individually.

dogtag uses a boolean for each search term to indicate that it is used.
Presense of the search item is not enough, both need to be set.

The search operation is unauthenticated

Design page: http://freeipa.org/page/V3/Cert_find

https://fedorahosted.org/freeipa/ticket/2528
This commit is contained in:
Rob Crittenden
2012-11-15 10:55:33 -05:00
parent 74c11d88ae
commit 462beacc9d
6 changed files with 598 additions and 22 deletions

23
API.txt
View File

@@ -425,6 +425,29 @@ args: 1,0,2
arg: Any('methods*')
output: Output('count', <type 'int'>, None)
output: Output('results', (<type 'list'>, <type 'tuple'>), None)
command: cert_find
args: 0,17,4
option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
option: Flag('exactly?', autofill=True, default=False)
option: Str('issuedon_from?', autofill=False)
option: Str('issuedon_to?', autofill=False)
option: Int('max_serial_number?', autofill=False, maxvalue=2147483647)
option: Int('min_serial_number?', autofill=False, minvalue=0)
option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui')
option: Int('revocation_reason?', autofill=False, maxvalue=10, minvalue=0)
option: Str('revokedon_from?', autofill=False)
option: Str('revokedon_to?', autofill=False)
option: Int('sizelimit?', default=100, minvalue=0)
option: Str('subject?', autofill=False)
option: Str('validnotafter_from?', autofill=False)
option: Str('validnotafter_to?', autofill=False)
option: Str('validnotbefore_from?', autofill=False)
option: Str('validnotbefore_to?', autofill=False)
option: Str('version?', exclude='webui')
output: Output('count', <type 'int'>, None)
output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None)
output: Output('truncated', <type 'bool'>, None)
command: cert_remove_hold
args: 1,0,1
arg: Str('serial_number')