Skip to content

Commit

Permalink
Merge pull request #91 from cloudforet-io/feature-identity-v2
Browse files Browse the repository at this point in the history
Feature identity v2
  • Loading branch information
ImMin5 authored Nov 23, 2023
2 parents a01c3d3 + 83735c5 commit 05a6f3c
Show file tree
Hide file tree
Showing 167 changed files with 5,367 additions and 6,013 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ test/reports
test/_trial_temp
/test/api/config.yml
skaffold.yaml

/src/spaceone/identity_v1
40 changes: 19 additions & 21 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,28 @@
from setuptools import setup, find_packages

setup(
name='spaceone-identity',
version=os.environ.get('PACKAGE_VERSION'),
description='SpaceONE identity service',
long_description='',
url='https://www.spaceone.dev/',
author='MEGAZONE SpaceONE Team',
author_email='[email protected]',
license='Apache License 2.0',
name="spaceone-identity",
version=os.environ.get("PACKAGE_VERSION"),
description="SpaceONE identity service",
long_description="",
url="https://www.spaceone.dev/",
author="MEGAZONE SpaceONE Team",
author_email="[email protected]",
license="Apache License 2.0",
packages=find_packages(),
install_requires=[
'spaceone-core',
'spaceone-api',
'mongoengine',
'langcodes',
'bcrypt',
"spaceone-core",
"spaceone-api",
"mongoengine",
"langcodes",
"bcrypt",
# 'bcrypt==3.1.6',
'redis',
'jinja2',
'fakeredis',
'mongomock',
'pytz'
"redis",
"jinja2",
"fakeredis",
"mongomock",
"pytz",
],
package_data={
'spaceone': ['identity/template/*.html']
},
package_data={"spaceone": ["identity/template/*.html"]},
zip_safe=False,
)
2 changes: 1 addition & 1 deletion src/spaceone/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
2 changes: 1 addition & 1 deletion src/spaceone/identity/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
name = 'identity'
__name__ = "identity"
154 changes: 62 additions & 92 deletions src/spaceone/identity/conf/global_conf.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
ROOT_DOMAIN_NAME = 'root'
EMAIL_CONSOLE_DOMAIN = ''
EMAIL_SERVICE_NAME = 'Cloudforet'
# ACCESS_TOKEN (default) / PASSWORD
RESET_PASSWORD_TYPE = 'ACCESS_TOKEN'
# Root Domain Settings
ROOT_DOMAIN_NAME = "root"

# Email Settings
EMAIL_CONSOLE_DOMAIN = ""
EMAIL_SERVICE_NAME = "Cloudforet"

# Enums: ACCESS_TOKEN (default) | PASSWORD
RESET_PASSWORD_TYPE = "ACCESS_TOKEN"

# Database Settings
DATABASE_AUTO_CREATE_INDEX = True
DATABASES = {
'default': {
"default": {
# 'db': '',
# 'host': '',
# 'port': 0,
Expand All @@ -16,110 +22,74 @@
}
}

# Cache Settings
CACHES = {
'default': {},
'local': {
'backend': 'spaceone.core.cache.local_cache.LocalCache',
'max_size': 128,
'ttl': 300
}
"default": {},
"local": {
"backend": "spaceone.core.cache.local_cache.LocalCache",
"max_size": 128,
"ttl": 300,
},
}

# Identity Settings
IDENTITY = {
'token': {
'verify_code_timeout': 3600,
'temporary_token_timeout': 86400, # 24 hours
'token_timeout': 1200,
'refresh_timeout': 1800,
'refresh_ttl': 18,
'refresh_once': False
"token": {
"verify_code_timeout": 3600,
"temporary_token_timeout": 86400, # 24 hours
"token_timeout": 1200,
"refresh_timeout": 1800,
"refresh_ttl": 18,
"refresh_once": False,
},
'mfa': {
'mfa_verify_code_timeout': 300
}
"mfa": {"mfa_verify_code_timeout": 300},
}

# Handler Settings
HANDLERS = {
# 'authentication': [{
# 'backend': 'spaceone.core.handler.authentication_handler.AuthenticationGRPCHandler',
# 'uri': 'grpc://localhost:50051/v1/Domain/get_public_key'
# "authentication": [{
# "backend": "spaceone.core.handler.authentication_handler.AuthenticationGRPCHandler",
# "uri": "grpc://localhost:50051/v1/Domain/get_public_key"
# }],
# 'authorization': [{
# 'backend': 'spaceone.core.handler.authorization_handler.AuthorizationGRPCHandler',
# 'uri': 'grpc://localhost:50051/v1/Authorization/verify'
# "authorization": [{
# "backend": "spaceone.core.handler.authorization_handler.AuthorizationGRPCHandler",
# "uri": "grpc://localhost:50051/v1/Authorization/verify"
# }],
# 'mutation': [{
# 'backend': 'spaceone.core.handler.mutation_handler.SpaceONEMutationHandler'
# "mutation": [{
# "backend": "spaceone.core.handler.mutation_handler.SpaceONEMutationHandler"
# }],
# 'event': []
# "event": []
}

# Connector Settings
CONNECTORS = {
'SpaceConnector': {
'backend': 'spaceone.core.connector.space_connector.SpaceConnector',
'endpoints': {
'plugin': 'grpc://plugin:50051',
'secret': 'grpc://secret:50051',
'repository': 'grpc://repository:50051'
}
"SpaceConnector": {
"backend": "spaceone.core.connector.space_connector.SpaceConnector",
"endpoints": {
"plugin": "grpc://plugin:50051",
"secret": "grpc://secret:50051",
"repository": "grpc://repository:50051",
},
},
"SMTPConnector": {
# "host": "smtp.mail.com",
# "port": "1234",
# "user": "cloudforet",
# "password": "1234",
# "from_email": "[email protected]",
},
'SMTPConnector': {
'host': 'smtp.mail.com',
'port': '1234',
'user': 'cloudforet',
'password': '1234',
'from_email': '[email protected]'
}
}

# Endpoint Settings
ENDPOINTS = [
# {
# 'service': 'identity',
# 'name': 'Identity Service',
# 'endpoint': 'grpc://<endpoint>>:<port>/v1'
# "service": "identity",
# "name": "Identity Service",
# "endpoint": "grpc://<endpoint>>:<port>"
# },
]

# Internal Endpoint
INTERNAL_ENDPOINTS = [
{
'service': 'identity',
'name': 'Identity Service',
'endpoint': 'grpc://identity.spaceone.svc.cluster.local:50051/v1'
},
{
'service': 'secret',
'name': 'Secret Service',
'endpoint': 'grpc://secret.spaceone.svc.cluster.local:50051/v1'
},
{
'service': 'repository',
'name': 'Repository Service',
'endpoint': 'grpc://repository.spaceone.svc.cluster.local:50051/v1'
},
{
'service': 'plugin',
'name': 'Plugin Service',
'endpoint': 'grpc://plugin.spaceone.svc.cluster.local:50051/v1'
},
{
'service': 'config',
'name': 'Config Service',
'endpoint': 'grpc://config.spaceone.svc.cluster.local:50051/v1'
},
{
'service': 'inventory',
'name': 'Inventory Service',
'endpoint': 'grpc://inventory.spaceone.svc.cluster.local:50051/v1'
},
{
'service': 'monitoring',
'name': 'Monitoring Service',
'endpoint': 'grpc://monitoring.spaceone.svc.cluster.local:50051/v1'
},
{
'service': 'statistics',
'name': 'Statistics Service',
'endpoint': 'grpc://statistics.spaceone.svc.cluster.local:50051/v1'
}
# {
# "service": "inventory",
# "name": "Inventory Service",
# "endpoint": "grpc+ssl://<endpoint>>:<port>"
# }
]
6 changes: 0 additions & 6 deletions src/spaceone/identity/conf/permissions_conf.py

This file was deleted.

16 changes: 0 additions & 16 deletions src/spaceone/identity/conf/proto_conf.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/spaceone/identity/connector/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
from spaceone.identity.connector.auth_plugin_connector import AuthPluginConnector
from spaceone.identity.connector.smtp_connector import SMTPConnector
97 changes: 0 additions & 97 deletions src/spaceone/identity/connector/auth_plugin_connector.py

This file was deleted.

Loading

0 comments on commit 05a6f3c

Please sign in to comment.