key_rotation_config.py 685 B

1234567891011121314151617
  1. """
  2. 密钥轮换配置模型
  3. """
  4. from sqlalchemy import Column, Integer, DateTime, SmallInteger
  5. from app.database import Base
  6. class KeyRotationConfig(Base):
  7. """密钥轮换配置表"""
  8. __tablename__ = "key_rotation_config"
  9. id = Column(Integer, primary_key=True, index=True, comment="主键ID")
  10. rotation_days = Column(Integer, default=10, comment="密钥轮换周期(天)")
  11. is_auto_rotate = Column(SmallInteger, default=1, comment="是否自动轮换")
  12. last_rotation_time = Column(DateTime, comment="最后轮换时间")
  13. next_rotation_time = Column(DateTime, comment="下次轮换时间")
  14. updated_at = Column(DateTime, comment="更新时间")