Skip to content

Commit

Permalink
Merge pull request #590 from yonetatuu/add_ldap_group
Browse files Browse the repository at this point in the history
LDAPグループとの連携強化
  • Loading branch information
ozota1 authored Mar 30, 2022
2 parents dc5840e + ff8776e commit 8d9a904
Show file tree
Hide file tree
Showing 73 changed files with 8,802 additions and 450 deletions.
8 changes: 6 additions & 2 deletions cli/kamonohashi/cli/tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def get(id):
@click.option('-rid', '--registry-ids', type=int, multiple=True, required=True, help='Registry id [multiple]')
@click.option('-drid', '--default-registry-id', type=int, help='A default registry id')
@click.option('-sid', '--storage-id', type=int, required=True, help='A storage id')
def create(name, display_name, git_ids, default_git_id, registry_ids, default_registry_id, storage_id):
@click.option('-ugid', '--user-group-ids', type=int, multiple=True, help='UserGroup id [multiple]')
def create(name, display_name, git_ids, default_git_id, registry_ids, default_registry_id, storage_id, user_group_ids):
"""Create a new tenant"""
api = rest.TenantApi(configuration.get_api_client())
model = rest.TenantApiModelsCreateInputModel(
Expand All @@ -52,6 +53,7 @@ def create(name, display_name, git_ids, default_git_id, registry_ids, default_re
registry_ids=list(registry_ids),
default_registry_id=default_registry_id,
storage_id=storage_id,
user_group_ids=list(user_group_ids),
)
result = api.create_tenant(body=model)
print('created', result.id)
Expand All @@ -65,7 +67,8 @@ def create(name, display_name, git_ids, default_git_id, registry_ids, default_re
@click.option('-rid', '--registry-ids', type=int, multiple=True, required=True, help='Registry id [multiple]')
@click.option('-drid', '--default-registry-id', type=int, help='A default registry id')
@click.option('-sid', '--storage-id', type=int, required=True, help='A storage id')
def update(id, display_name, git_ids, default_git_id, registry_ids, default_registry_id, storage_id):
@click.option('-ugid', '--user-group-ids', type=int, multiple=True, help='UserGroup id [multiple]')
def update(id, display_name, git_ids, default_git_id, registry_ids, default_registry_id, storage_id, user_group_ids):
"""Update a tenant"""
api = rest.TenantApi(configuration.get_api_client())
model = rest.TenantApiModelsEditInputModel(
Expand All @@ -75,6 +78,7 @@ def update(id, display_name, git_ids, default_git_id, registry_ids, default_regi
registry_ids=list(registry_ids),
default_registry_id=default_registry_id,
storage_id=storage_id,
user_group_ids=list(user_group_ids),
)
result = api.update_tenant(id, body=model)
print('updated', result.id)
Expand Down
84 changes: 81 additions & 3 deletions sdk/kamonohashi/op/rest/models/infos_role_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,32 @@ class InfosRoleInfo(object):
'display_name': 'str',
'id': 'int',
'is_customed': 'bool',
'name': 'str'
'is_origin': 'bool',
'name': 'str',
'sort_order': 'int',
'user_group_tanant_map_id_lists': 'list[int]'
}

attribute_map = {
'display_name': 'displayName',
'id': 'id',
'is_customed': 'isCustomed',
'name': 'name'
'is_origin': 'isOrigin',
'name': 'name',
'sort_order': 'sortOrder',
'user_group_tanant_map_id_lists': 'userGroupTanantMapIdLists'
}

def __init__(self, display_name=None, id=None, is_customed=None, name=None): # noqa: E501
def __init__(self, display_name=None, id=None, is_customed=None, is_origin=None, name=None, sort_order=None, user_group_tanant_map_id_lists=None): # noqa: E501
"""InfosRoleInfo - a model defined in Swagger""" # noqa: E501

self._display_name = None
self._id = None
self._is_customed = None
self._is_origin = None
self._name = None
self._sort_order = None
self._user_group_tanant_map_id_lists = None
self.discriminator = None

if display_name is not None:
Expand All @@ -59,8 +68,14 @@ def __init__(self, display_name=None, id=None, is_customed=None, name=None): #
self.id = id
if is_customed is not None:
self.is_customed = is_customed
if is_origin is not None:
self.is_origin = is_origin
if name is not None:
self.name = name
if sort_order is not None:
self.sort_order = sort_order
if user_group_tanant_map_id_lists is not None:
self.user_group_tanant_map_id_lists = user_group_tanant_map_id_lists

@property
def display_name(self):
Expand Down Expand Up @@ -125,6 +140,27 @@ def is_customed(self, is_customed):

self._is_customed = is_customed

@property
def is_origin(self):
"""Gets the is_origin of this InfosRoleInfo. # noqa: E501
:return: The is_origin of this InfosRoleInfo. # noqa: E501
:rtype: bool
"""
return self._is_origin

@is_origin.setter
def is_origin(self, is_origin):
"""Sets the is_origin of this InfosRoleInfo.
:param is_origin: The is_origin of this InfosRoleInfo. # noqa: E501
:type: bool
"""

self._is_origin = is_origin

@property
def name(self):
"""Gets the name of this InfosRoleInfo. # noqa: E501
Expand All @@ -146,6 +182,48 @@ def name(self, name):

self._name = name

@property
def sort_order(self):
"""Gets the sort_order of this InfosRoleInfo. # noqa: E501
:return: The sort_order of this InfosRoleInfo. # noqa: E501
:rtype: int
"""
return self._sort_order

@sort_order.setter
def sort_order(self, sort_order):
"""Sets the sort_order of this InfosRoleInfo.
:param sort_order: The sort_order of this InfosRoleInfo. # noqa: E501
:type: int
"""

self._sort_order = sort_order

@property
def user_group_tanant_map_id_lists(self):
"""Gets the user_group_tanant_map_id_lists of this InfosRoleInfo. # noqa: E501
:return: The user_group_tanant_map_id_lists of this InfosRoleInfo. # noqa: E501
:rtype: list[int]
"""
return self._user_group_tanant_map_id_lists

@user_group_tanant_map_id_lists.setter
def user_group_tanant_map_id_lists(self, user_group_tanant_map_id_lists):
"""Sets the user_group_tanant_map_id_lists of this InfosRoleInfo.
:param user_group_tanant_map_id_lists: The user_group_tanant_map_id_lists of this InfosRoleInfo. # noqa: E501
:type: list[int]
"""

self._user_group_tanant_map_id_lists = user_group_tanant_map_id_lists

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
28 changes: 27 additions & 1 deletion sdk/kamonohashi/op/rest/models/infos_tenant_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class InfosTenantInfo(object):
'default': 'bool',
'display_name': 'str',
'id': 'int',
'is_origin': 'bool',
'name': 'str',
'roles': 'list[InfosRoleInfo]'
}
Expand All @@ -42,16 +43,18 @@ class InfosTenantInfo(object):
'default': 'default',
'display_name': 'displayName',
'id': 'id',
'is_origin': 'isOrigin',
'name': 'name',
'roles': 'roles'
}

def __init__(self, default=None, display_name=None, id=None, name=None, roles=None): # noqa: E501
def __init__(self, default=None, display_name=None, id=None, is_origin=None, name=None, roles=None): # noqa: E501
"""InfosTenantInfo - a model defined in Swagger""" # noqa: E501

self._default = None
self._display_name = None
self._id = None
self._is_origin = None
self._name = None
self._roles = None
self.discriminator = None
Expand All @@ -62,6 +65,8 @@ def __init__(self, default=None, display_name=None, id=None, name=None, roles=No
self.display_name = display_name
if id is not None:
self.id = id
if is_origin is not None:
self.is_origin = is_origin
if name is not None:
self.name = name
if roles is not None:
Expand Down Expand Up @@ -130,6 +135,27 @@ def id(self, id):

self._id = id

@property
def is_origin(self):
"""Gets the is_origin of this InfosTenantInfo. # noqa: E501
:return: The is_origin of this InfosTenantInfo. # noqa: E501
:rtype: bool
"""
return self._is_origin

@is_origin.setter
def is_origin(self, is_origin):
"""Sets the is_origin of this InfosTenantInfo.
:param is_origin: The is_origin of this InfosTenantInfo. # noqa: E501
:type: bool
"""

self._is_origin = is_origin

@property
def name(self):
"""Gets the name of this InfosTenantInfo. # noqa: E501
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class TenantApiModelsCreateInputModel(object):
'git_ids': 'list[int]',
'registry_ids': 'list[int]',
'storage_id': 'int',
'tenant_name': 'str'
'tenant_name': 'str',
'user_group_ids': 'list[int]'
}

attribute_map = {
Expand All @@ -49,10 +50,11 @@ class TenantApiModelsCreateInputModel(object):
'git_ids': 'gitIds',
'registry_ids': 'registryIds',
'storage_id': 'storageId',
'tenant_name': 'tenantName'
'tenant_name': 'tenantName',
'user_group_ids': 'userGroupIds'
}

def __init__(self, available_infinite_time_notebook=None, default_git_id=None, default_registry_id=None, display_name=None, git_ids=None, registry_ids=None, storage_id=None, tenant_name=None): # noqa: E501
def __init__(self, available_infinite_time_notebook=None, default_git_id=None, default_registry_id=None, display_name=None, git_ids=None, registry_ids=None, storage_id=None, tenant_name=None, user_group_ids=None): # noqa: E501
"""TenantApiModelsCreateInputModel - a model defined in Swagger""" # noqa: E501

self._available_infinite_time_notebook = None
Expand All @@ -63,6 +65,7 @@ def __init__(self, available_infinite_time_notebook=None, default_git_id=None, d
self._registry_ids = None
self._storage_id = None
self._tenant_name = None
self._user_group_ids = None
self.discriminator = None

if available_infinite_time_notebook is not None:
Expand All @@ -76,6 +79,8 @@ def __init__(self, available_infinite_time_notebook=None, default_git_id=None, d
self.registry_ids = registry_ids
self.storage_id = storage_id
self.tenant_name = tenant_name
if user_group_ids is not None:
self.user_group_ids = user_group_ids

@property
def available_infinite_time_notebook(self):
Expand Down Expand Up @@ -257,6 +262,27 @@ def tenant_name(self, tenant_name):

self._tenant_name = tenant_name

@property
def user_group_ids(self):
"""Gets the user_group_ids of this TenantApiModelsCreateInputModel. # noqa: E501
:return: The user_group_ids of this TenantApiModelsCreateInputModel. # noqa: E501
:rtype: list[int]
"""
return self._user_group_ids

@user_group_ids.setter
def user_group_ids(self, user_group_ids):
"""Sets the user_group_ids of this TenantApiModelsCreateInputModel.
:param user_group_ids: The user_group_ids of this TenantApiModelsCreateInputModel. # noqa: E501
:type: list[int]
"""

self._user_group_ids = user_group_ids

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class TenantApiModelsDetailsOutputModel(object):
'name': 'str',
'registry_ids': 'list[int]',
'storage_id': 'int',
'storage_path': 'str'
'storage_path': 'str',
'user_group_ids': 'list[int]'
}

attribute_map = {
Expand All @@ -61,10 +62,11 @@ class TenantApiModelsDetailsOutputModel(object):
'name': 'name',
'registry_ids': 'registryIds',
'storage_id': 'storageId',
'storage_path': 'storagePath'
'storage_path': 'storagePath',
'user_group_ids': 'userGroupIds'
}

def __init__(self, available_infinite_time_notebook=None, created_at=None, created_by=None, default_git_id=None, default_registry_id=None, display_name=None, git_ids=None, id=None, modified_at=None, modified_by=None, name=None, registry_ids=None, storage_id=None, storage_path=None): # noqa: E501
def __init__(self, available_infinite_time_notebook=None, created_at=None, created_by=None, default_git_id=None, default_registry_id=None, display_name=None, git_ids=None, id=None, modified_at=None, modified_by=None, name=None, registry_ids=None, storage_id=None, storage_path=None, user_group_ids=None): # noqa: E501
"""TenantApiModelsDetailsOutputModel - a model defined in Swagger""" # noqa: E501

self._available_infinite_time_notebook = None
Expand All @@ -81,6 +83,7 @@ def __init__(self, available_infinite_time_notebook=None, created_at=None, creat
self._registry_ids = None
self._storage_id = None
self._storage_path = None
self._user_group_ids = None
self.discriminator = None

if available_infinite_time_notebook is not None:
Expand Down Expand Up @@ -111,6 +114,8 @@ def __init__(self, available_infinite_time_notebook=None, created_at=None, creat
self.storage_id = storage_id
if storage_path is not None:
self.storage_path = storage_path
if user_group_ids is not None:
self.user_group_ids = user_group_ids

@property
def available_infinite_time_notebook(self):
Expand Down Expand Up @@ -406,6 +411,27 @@ def storage_path(self, storage_path):

self._storage_path = storage_path

@property
def user_group_ids(self):
"""Gets the user_group_ids of this TenantApiModelsDetailsOutputModel. # noqa: E501
:return: The user_group_ids of this TenantApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[int]
"""
return self._user_group_ids

@user_group_ids.setter
def user_group_ids(self, user_group_ids):
"""Sets the user_group_ids of this TenantApiModelsDetailsOutputModel.
:param user_group_ids: The user_group_ids of this TenantApiModelsDetailsOutputModel. # noqa: E501
:type: list[int]
"""

self._user_group_ids = user_group_ids

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
Loading

0 comments on commit 8d9a904

Please sign in to comment.