feat:kintone APIのパスワードの暗号化対応

This commit is contained in:
xiaozhe.ma
2024-08-05 19:26:31 +09:00
parent 48f2c4a2d1
commit 35df63664e
4 changed files with 12 additions and 9 deletions

View File

@@ -2,6 +2,8 @@ from sqlalchemy import Boolean, Column, Integer, String, DateTime,ForeignKey
from sqlalchemy.ext.declarative import as_declarative
from datetime import datetime
from app.core.security import chacha20Decrypt
@as_declarative()
class Base:
id = Column(Integer, primary_key=True, index=True)
@@ -68,6 +70,9 @@ class Domain(Base):
url = Column(String(200), nullable=False)
kintoneuser = Column(String(100), nullable=False)
kintonepwd = Column(String(100), nullable=False)
def decrypt_kintonepwd(self):
decrypted_pwd = chacha20Decrypt(self.kintonepwd)
return decrypted_pwd
class UserDomain(Base):