Skip to content

Commit

Permalink
Merge pull request #64 from hibiya-itchief/取得上限を取り払う
Browse files Browse the repository at this point in the history
整理券の取得上限を消す
  • Loading branch information
aozoraUS authored Sep 11, 2024
2 parents e1684ae + de55dc0 commit a27148a
Showing 1 changed file with 68 additions and 61 deletions.
129 changes: 68 additions & 61 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,95 +6,102 @@

load_dotenv()


class Parameters(BaseSettings):
person_per_user:int=3 # 1つのユーザーで同時入場できる人数
max_tickets:int=6 # 全日程を通して取得できる整理券の上限(0で制限無し)
max_tickets_per_day:int=6 # 1日あたりの取得できる整理券の上限(0で上限無し)各公演の開始時刻で判定されます
person_per_user: int = 3 # 1つのユーザーで同時入場できる人数
max_tickets: int = 0 # 全日程を通して取得できる整理券の上限(0で制限無し)
max_tickets_per_day: int = (
0 # 1日あたりの取得できる整理券の上限(0で上限無し)各公演の開始時刻で判定されます
)


class Settings(BaseSettings):
mysql_user:str=os.getenv('MYSQL_USER')
mysql_password:str=os.getenv('MYSQL_PASSWORD')
db_host:str=os.getenv('DB_HOST')
mysql_database:str=os.getenv('MYSQL_DATABASE')
mysql_user: str = os.getenv("MYSQL_USER")
mysql_password: str = os.getenv("MYSQL_PASSWORD")
db_host: str = os.getenv("DB_HOST")
mysql_database: str = os.getenv("MYSQL_DATABASE")

jwt_privatekey:str=os.getenv('JWT_PRIVATEKEY')
jwt_publickey:str="-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0i+BMxUUgG6slPW/9oHP\nUrYpoLX08NNTsFpEwAkpBHxzbauFc2SmFaFnmkkco8lfCQs66sj6fwtTtSc4RH+Z\nncFRaxV5M+AS7utyGhS9iNAg6u5DaGAxbMm1NAqUkuNLGS+pVx+p75b681inCBBu\nVxpPF0eCNMsUfMPDBKKKS6ABuIpl4Ep3BDXLCSfciBFixDA6poIDy7tryfcpglyw\nuq84ROrOBLU3kTaTM4zl8x2VRkGGdU88+7WhpVgB7s7uSJmzmWtojvDGp+1tylqp\nB4geNVB8rjqkZQjr9Y0oI2sJuIAYzDaBWwQsVUMmp2JO64kR8P1P7i99graUaGOd\nJwIDAQAB\n-----END PUBLIC KEY-----"
jwt_privatekey: str = os.getenv("JWT_PRIVATEKEY")
jwt_publickey: str = (
"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0i+BMxUUgG6slPW/9oHP\nUrYpoLX08NNTsFpEwAkpBHxzbauFc2SmFaFnmkkco8lfCQs66sj6fwtTtSc4RH+Z\nncFRaxV5M+AS7utyGhS9iNAg6u5DaGAxbMm1NAqUkuNLGS+pVx+p75b681inCBBu\nVxpPF0eCNMsUfMPDBKKKS6ABuIpl4Ep3BDXLCSfciBFixDA6poIDy7tryfcpglyw\nuq84ROrOBLU3kTaTM4zl8x2VRkGGdU88+7WhpVgB7s7uSJmzmWtojvDGp+1tylqp\nB4geNVB8rjqkZQjr9Y0oI2sJuIAYzDaBWwQsVUMmp2JO64kR8P1P7i99graUaGOd\nJwIDAQAB\n-----END PUBLIC KEY-----"
)

# 星陵祭の設定
family_ticket_sell_starts:str = os.getenv('FAMILY_TICKET_SELL_STARTS')
family_ticket_sell_starts: str = os.getenv("FAMILY_TICKET_SELL_STARTS")

# Azure Blob Storage
connect_str:str = os.getenv('AZURE_STORAGE_CONNECTION_STRING')
container_name:str = os.getenv('AZURE_BLOB_STORAGE_CONTAINER_NAME')
connect_str: str = os.getenv("AZURE_STORAGE_CONNECTION_STRING")
container_name: str = os.getenv("AZURE_BLOB_STORAGE_CONTAINER_NAME")

# Parameter

## Azure Config
azure_b2c_openidconfiguration='https://seiryofesb2c.b2clogin.com/seiryofesb2c.onmicrosoft.com/v2.0/.well-known/openid-configuration?p=B2C_1_quaint-app'
azure_b2c_audience='06b8cb1b-b866-43bf-9bc6-2898c6a149f3'
azure_ad_openidconfiguration='https://login.microsoftonline.com/158e6d17-f3d5-4365-8428-26dfc74a9d27/v2.0/.well-known/openid-configuration'
azure_ad_audience='0f2252c5-62ef-4aab-af65-99a753f1c77c'
azure_b2c_openidconfiguration = "https://seiryofesb2c.b2clogin.com/seiryofesb2c.onmicrosoft.com/v2.0/.well-known/openid-configuration?p=B2C_1_quaint-app"
azure_b2c_audience = "06b8cb1b-b866-43bf-9bc6-2898c6a149f3"
azure_ad_openidconfiguration = "https://login.microsoftonline.com/158e6d17-f3d5-4365-8428-26dfc74a9d27/v2.0/.well-known/openid-configuration"
azure_ad_audience = "0f2252c5-62ef-4aab-af65-99a753f1c77c"

b2c_msgraph_tenant:str='450b2222-dcb5-471d-9657-bb4ee50acd97'
b2c_msgraph_client:str='06b8cb1b-b866-43bf-9bc6-2898c6a149f3'
b2c_msgraph_secret:str=os.getenv('B2C_MSGRAPH_SECRET')
b2c_msgraph_tenant: str = "450b2222-dcb5-471d-9657-bb4ee50acd97"
b2c_msgraph_client: str = "06b8cb1b-b866-43bf-9bc6-2898c6a149f3"
b2c_msgraph_secret: str = os.getenv("B2C_MSGRAPH_SECRET")

## Azure AD groups UUID
azure_ad_groups_quaint_admin='5c091517-25de-44bc-9e42-ffcb8539435c'
azure_ad_groups_quaint_entry='63a40184-8dab-43b4-8367-54e84ace6e2a'
azure_ad_groups_quaint_owner='a577d858-64bf-4815-aaf6-d893c654e92e'
azure_ad_groups_quaint_parents='ecd46dae-d84b-42d8-9357-ac24d480a168'
azure_ad_groups_quaint_students='865bb05d-cb7d-4919-b18d-8b977ec0499b'
azure_ad_groups_quaint_teachers='0a8ee476-cd37-4c31-bd6e-c34e750574f4'
azure_ad_groups_quaint_chief='67e48f08-22e0-4ec4-9674-1428aaa5c055'
azure_ad_groups_quaint_guest='94c45b57-680c-4b5b-a98b-d78f1fd90d71'
azure_ad_groups_quaint_admin = "5c091517-25de-44bc-9e42-ffcb8539435c"
azure_ad_groups_quaint_entry = "63a40184-8dab-43b4-8367-54e84ace6e2a"
azure_ad_groups_quaint_owner = "a577d858-64bf-4815-aaf6-d893c654e92e"
azure_ad_groups_quaint_parents = "ecd46dae-d84b-42d8-9357-ac24d480a168"
azure_ad_groups_quaint_students = "865bb05d-cb7d-4919-b18d-8b977ec0499b"
azure_ad_groups_quaint_teachers = "0a8ee476-cd37-4c31-bd6e-c34e750574f4"
azure_ad_groups_quaint_chief = "67e48f08-22e0-4ec4-9674-1428aaa5c055"
azure_ad_groups_quaint_guest = "94c45b57-680c-4b5b-a98b-d78f1fd90d71"
# 保護者のグループ
# 1年
azure_ad_groups_quaint_parents_11r = '12c1a97c-3d99-4c4b-b70b-28e9c0c44652'
azure_ad_groups_quaint_parents_12r = '59497287-931a-4c12-84d3-58406988210d'
azure_ad_groups_quaint_parents_13r = '0ed9e48e-b2a0-4fb6-9045-a266d64a6248'
azure_ad_groups_quaint_parents_14r = '1372ce7a-3151-4657-81f2-82ec0c75082e'
azure_ad_groups_quaint_parents_15r = '0f860b70-ae51-4663-b69b-a7d972da9037'
azure_ad_groups_quaint_parents_16r = 'df919a87-e198-4c9a-9ee5-5c7763aa68c0'
azure_ad_groups_quaint_parents_17r = '7487b933-88f4-4d11-b055-9eee011d917b'
azure_ad_groups_quaint_parents_18r = 'd2d27aa4-8a2e-43af-843c-aff23bc68310'
azure_ad_groups_quaint_parents_11r = "12c1a97c-3d99-4c4b-b70b-28e9c0c44652"
azure_ad_groups_quaint_parents_12r = "59497287-931a-4c12-84d3-58406988210d"
azure_ad_groups_quaint_parents_13r = "0ed9e48e-b2a0-4fb6-9045-a266d64a6248"
azure_ad_groups_quaint_parents_14r = "1372ce7a-3151-4657-81f2-82ec0c75082e"
azure_ad_groups_quaint_parents_15r = "0f860b70-ae51-4663-b69b-a7d972da9037"
azure_ad_groups_quaint_parents_16r = "df919a87-e198-4c9a-9ee5-5c7763aa68c0"
azure_ad_groups_quaint_parents_17r = "7487b933-88f4-4d11-b055-9eee011d917b"
azure_ad_groups_quaint_parents_18r = "d2d27aa4-8a2e-43af-843c-aff23bc68310"
# 2年
azure_ad_groups_quaint_parents_21r = '5be0f149-9d15-472b-b25f-5eb874ace869'
azure_ad_groups_quaint_parents_22r = '6fa005c2-a225-4e5b-80dd-b5b7f72fce1a'
azure_ad_groups_quaint_parents_23r = 'fdd3031f-105a-4369-ac7a-028cf00ddd91'
azure_ad_groups_quaint_parents_24r = 'c599b4e8-a5cb-4bd2-aaea-e32e1719d8d1'
azure_ad_groups_quaint_parents_25r = 'cf04417a-324b-4581-b6a6-efffe9574f66'
azure_ad_groups_quaint_parents_26r = '94729412-e00b-4a02-9436-784b7c0f9dee'
azure_ad_groups_quaint_parents_27r = '296d09c8-fc79-4787-845c-68abdc705771'
azure_ad_groups_quaint_parents_28r = 'c023ca3d-9618-4950-b2e2-50c064bcbe75'
azure_ad_groups_quaint_parents_21r = "5be0f149-9d15-472b-b25f-5eb874ace869"
azure_ad_groups_quaint_parents_22r = "6fa005c2-a225-4e5b-80dd-b5b7f72fce1a"
azure_ad_groups_quaint_parents_23r = "fdd3031f-105a-4369-ac7a-028cf00ddd91"
azure_ad_groups_quaint_parents_24r = "c599b4e8-a5cb-4bd2-aaea-e32e1719d8d1"
azure_ad_groups_quaint_parents_25r = "cf04417a-324b-4581-b6a6-efffe9574f66"
azure_ad_groups_quaint_parents_26r = "94729412-e00b-4a02-9436-784b7c0f9dee"
azure_ad_groups_quaint_parents_27r = "296d09c8-fc79-4787-845c-68abdc705771"
azure_ad_groups_quaint_parents_28r = "c023ca3d-9618-4950-b2e2-50c064bcbe75"
# 3年
azure_ad_groups_quaint_parents_31r = '3d983fe1-8c30-4540-85e7-53b4ca98eab6'
azure_ad_groups_quaint_parents_32r = '7ffec498-ceb2-487c-b017-3098fb1b0d3a'
azure_ad_groups_quaint_parents_33r = 'bcb43367-585d-44a7-9896-36d85aeeda6c'
azure_ad_groups_quaint_parents_34r = '5a619348-a1c8-46c1-ba47-83bdeaf4c2b4'
azure_ad_groups_quaint_parents_35r = 'b591ff60-1217-4253-b948-d0801509511a'
azure_ad_groups_quaint_parents_36r = 'b912ad1e-c692-42d0-9115-74bc62a4158e'
azure_ad_groups_quaint_parents_37r = '2fe29736-f843-4d4a-aec5-100c8804062e'
azure_ad_groups_quaint_parents_38r = '28711a00-fca2-4fb7-90cb-5823d1feb9d6'
azure_ad_groups_quaint_parents_31r = "3d983fe1-8c30-4540-85e7-53b4ca98eab6"
azure_ad_groups_quaint_parents_32r = "7ffec498-ceb2-487c-b017-3098fb1b0d3a"
azure_ad_groups_quaint_parents_33r = "bcb43367-585d-44a7-9896-36d85aeeda6c"
azure_ad_groups_quaint_parents_34r = "5a619348-a1c8-46c1-ba47-83bdeaf4c2b4"
azure_ad_groups_quaint_parents_35r = "b591ff60-1217-4253-b948-d0801509511a"
azure_ad_groups_quaint_parents_36r = "b912ad1e-c692-42d0-9115-74bc62a4158e"
azure_ad_groups_quaint_parents_37r = "2fe29736-f843-4d4a-aec5-100c8804062e"
azure_ad_groups_quaint_parents_38r = "28711a00-fca2-4fb7-90cb-5823d1feb9d6"

## JWT EXPIRE
access_token_expire:datetime.timedelta=datetime.timedelta(days=10)
access_token_expire: datetime.timedelta = datetime.timedelta(days=10)

production_flag:int=os.getenv("PRODUCTION_FLAG",0)
api_hostname:str=os.getenv("API_HOSTNAME","DEFAULT")
production_flag: int = os.getenv("PRODUCTION_FLAG", 0)
api_hostname: str = os.getenv("API_HOSTNAME", "DEFAULT")

## Cloudflare deploy hook url
cloudflare_deploy_hook_url:str=os.getenv("CLOUDFLARE_DEPLOY_HOOK_URL","")
cloudflare_deploy_hook_url: str = os.getenv("CLOUDFLARE_DEPLOY_HOOK_URL", "")

## Redis
redis_host:str=os.getenv("REDIS_HOST","")
redis_host: str = os.getenv("REDIS_HOST", "")

## Google Analytics Property ID
ga_property_id:str=os.getenv("GA_PROPERTY_ID","")
ga_property_id: str = os.getenv("GA_PROPERTY_ID", "")

class Config:
env_file = 'app/.env'
secrets_dir='/run/secrets'
env_file = "app/.env"
secrets_dir = "/run/secrets"


params=Parameters()
settings= Settings()
params = Parameters()
settings = Settings()

1 comment on commit a27148a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
workspace/app
   auth.py33718844%34, 38–39, 47–57, 67, 71, 75–79, 88–89, 94, 100–102, 107, 114–115, 117–120, 128–129, 132–135, 138–144, 146–149, 154, 156, 158, 161–167, 169–172, 175–181, 183–186, 192–194, 196–199, 209, 230–233, 237–240, 244–247, 251–254, 258–261, 265–268, 272–275, 279–282, 286–289, 293–296, 300–303, 307–310, 314–317, 321–324, 335–338, 342–345, 349–352, 356–359, 363–366, 370–373, 377–380, 384–387, 395–398, 403, 408, 410, 413–416, 418, 421–424, 426, 428–431, 433, 435–438, 443, 445, 447, 449, 452–475
   blob_storage.py593836%35–54, 57–77, 80–85
   crud.py46816864%41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 70–87, 93–97, 101–105, 119, 126, 129–130, 144–152, 191, 261–272, 333–351, 373, 377–378, 418, 454, 459, 464, 469, 497–509, 513–516, 520–524, 540–552, 556–566, 594–598, 602–603, 612–618, 622–627, 642–645, 718, 722, 726–736, 740–750, 758, 798, 882–883, 982, 986–991, 995–1003, 1007–1012, 1016–1024
   db.py221150%19–30
   ga.py261831%16–32, 34–45
   main.py46620855%45, 116, 130, 146, 173–177, 205, 235–238, 253–256, 278–284, 303, 325, 328, 364, 386–397, 415, 417, 444, 446, 449, 473, 477–478, 495, 514, 522, 542, 545, 553, 576–588, 601–615, 629–642, 662–670, 703–714, 739–768, 800, 802, 818–824, 842–855, 872–879, 895–898, 931–939, 953–961, 996, 1033, 1070, 1115–1118, 1129, 1141–1144, 1161–1164, 1179–1182, 1193, 1211–1215, 1230–1241, 1253–1257, 1267–1271, 1286, 1301, 1311, 1321, 1336, 1351, 1368
   models.py90397%125–127
   msgraph.py311939%14, 16–42, 44–47, 50–63
   redis_possible.py21481%12–13, 21–22
   schemas.py172199%207
workspace/app/test
   conftest.py19195%31
TOTAL244865973% 

Please sign in to comment.