-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d354b9
commit 18643f3
Showing
10 changed files
with
88 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,36 @@ DB_USER= | |
DB_PASS= | ||
DB_NAME= | ||
WORKDAY_CUT_OFF_TIME= | ||
MINIMUM_WORKING_HOURS= | ||
MINIMUM_WORKING_HOURS= | ||
HOLIDAYS_API_URL= | ||
HOLIDAYS_API_KEY= | ||
COUNTRY= | ||
|
||
|
||
|
||
3. Create a Workload Identity on Google Cloud with gcloud | ||
export GITHUB_REPO=Will413028/attendance-system-fastapi | ||
|
||
export PROJECT_ID=evident-airline-412703 | ||
|
||
export SERVICE_ACCOUNT=github-actions-service-account | ||
|
||
export WORKLOAD_IDENTITY_POOL=gh-pool | ||
|
||
export WORKLOAD_IDENTITY_PROVIDER=gh-provider | ||
|
||
|
||
echo $WORKLOAD_IDENTITY_PROVIDER_LOCATION | ||
|
||
projects/227244282831/locations/global/workloadIdentityPools/gh-pool/providers/gh-provider | ||
|
||
|
||
echo $SERVICE_ACCOUNT@$PROJECT_ID.iam.gserviceaccount.com | ||
|
||
github-actions-service-account@evident-airline-412703.iam.gserviceaccount.com | ||
|
||
test | ||
DATABASE_URL=mysql+pymysql://myuser:12345678@localhost:3306/attendance-system | ||
|
||
google sql | ||
DATABASE_URL=mysql+pymysql://root:[email protected]:3306/attendance-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from passlib.context import CryptContext | ||
|
||
|
||
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from functools import wraps | ||
|
||
|
||
def cache_holiday_check(func): | ||
holiday_cache = {} | ||
|
||
@wraps(func) | ||
def wrapper_check_holiday(date, *args, **kwargs): | ||
if date in holiday_cache: | ||
print('has ') | ||
|
||
return holiday_cache[date] | ||
is_holiday = func(date, *args, **kwargs) | ||
holiday_cache[date] = is_holiday | ||
return is_holiday | ||
return wrapper_check_holiday |
File renamed without changes.