Fixes (#329)
* Modifying the way roles are assigned. * Adding migration scripts. * Adding endpoints field for future use. * Fixing dropdowns.
This commit is contained in:
@ -38,7 +38,7 @@ class AuthorityInputSchema(LemurInputSchema):
|
||||
|
||||
# signing related options
|
||||
type = fields.String(validate=validate.OneOf(['root', 'subca']), missing='root')
|
||||
authority = fields.Nested(AssociatedAuthoritySchema)
|
||||
parent = fields.Nested(AssociatedAuthoritySchema)
|
||||
signing_algorithm = fields.String(validate=validate.OneOf(['sha256WithRSA', 'sha1WithRSA']), missing='sha256WithRSA')
|
||||
key_type = fields.String(validate=validate.OneOf(['RSA2048', 'RSA4096']), missing='RSA2048')
|
||||
key_name = fields.String()
|
||||
|
@ -48,7 +48,7 @@ def mint(**kwargs):
|
||||
return body, chain, roles
|
||||
|
||||
|
||||
def create_authority_roles(roles, **kwargs):
|
||||
def create_authority_roles(**kwargs):
|
||||
"""
|
||||
Creates all of the necessary authority roles.
|
||||
:param roles:
|
||||
@ -56,7 +56,7 @@ def create_authority_roles(roles, **kwargs):
|
||||
:return:
|
||||
"""
|
||||
role_objs = []
|
||||
for r in roles:
|
||||
for r in kwargs['roles']:
|
||||
role = role_service.create(
|
||||
r['name'],
|
||||
password=r['password'],
|
||||
@ -91,7 +91,12 @@ def create(**kwargs):
|
||||
kwargs['body'] = body
|
||||
kwargs['chain'] = chain
|
||||
|
||||
kwargs['roles'] = create_authority_roles(roles, **kwargs)
|
||||
if kwargs.get('roles'):
|
||||
kwargs['roles'] += roles
|
||||
else:
|
||||
kwargs['roles'] = roles
|
||||
|
||||
kwargs['roles'] = create_authority_roles(**kwargs)
|
||||
|
||||
if kwargs['type'] == 'subca':
|
||||
description = "This is the ROOT certificate for the {0} sub certificate authority the parent \
|
||||
|
Reference in New Issue
Block a user