Skip to content

Commit

Permalink
Add API KEY security
Browse files Browse the repository at this point in the history
  • Loading branch information
Rivinger7 committed Jul 29, 2024
1 parent da55f75 commit 542e0e8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/azure-webapps-dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ jobs:
name: .net-app
path: ${{ github.workspace }}/myapp

- name: Set environment variables
run: |
echo "DB_CONNECTION_USER_ID=${{ secrets.DB_CONNECTION_USER_ID }}" >> $GITHUB_ENV
echo "DB_CONNECTION_PASSWORD=${{ secrets.DB_CONNECTION_PASSWORD }}" >> $GITHUB_ENV
echo "GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }}" >> $GITHUB_ENV
echo "GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }}" >> $GITHUB_ENV
echo "EMAIL_SMTP_USERNAME=${{ secrets.EMAIL_SMTP_USERNAME }}" >> $GITHUB_ENV
echo "EMAIL_SMTP_PASSWORD=${{ secrets.EMAIL_SMTP_PASSWORD }}" >> $GITHUB_ENV
echo "VNPAY_TMNCODE=${{ secrets.VNPAY_TMNCODE }}" >> $GITHUB_ENV
echo "VNPAY_HASHSECRET=${{ secrets.VNPAY_HASHSECRET }}" >> $GITHUB_ENV
echo "MOMO_API_SECRETKEY=${{ secrets.MOMO_API_SECRETKEY }}" >> $GITHUB_ENV
echo "MOMO_API_ACCESSKEY=${{ secrets.MOMO_API_ACCESSKEY }}" >> $GITHUB_ENV
echo "MOMO_API_PARTNERCODE=${{ secrets.MOMO_API_PARTNERCODE }}" >> $GITHUB_ENV
echo "MOMO_API_PUBLICKEY=${{ secrets.MOMO_API_PUBLICKEY }}" >> $GITHUB_ENV
echo "ZEROBOUNCE_APIKEY=${{ secrets.ZEROBOUNCE_APIKEY }}" >> $GITHUB_ENV
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
Expand Down
26 changes: 13 additions & 13 deletions Dental_Clinic_System/Dental_Clinic_System/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ConnectionStrings": {
"DBConnection": "Server=tcp:dentalcareplatformdb.database.windows.net,1433;Initial Catalog=dentalcareplatformdb;Persist Security Info=False;User ID=dentalcare;Password=Dental123;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;"
"DBConnection": "Server=tcp:dentalcareplatformdb.database.windows.net,1433;Initial Catalog=dentalcareplatformdb;Persist Security Info=False;User ID=${DB_CONNECTION_USER_ID};Password=${DB_CONNECTION_PASSWORD};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;"
},

"Logging": {
Expand All @@ -10,22 +10,22 @@
}
},
"GoogleKeys": {
"ClientId": "867903141504-fbch43hp4ut43b9avqslbgljkirvo2j6.apps.googleusercontent.com",
"ClientSecret": "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"
"ClientId": "${GOOGLE_CLIENT_ID}",
"ClientSecret": "${GOOGLE_CLIENT_SECRET}"
},
"Email": {
"Smtp": {
"Host": "smtp.gmail.com",
"Port": "587",
"Username": "[email protected]",
"Password": "wehh hfpb kcuy lfxg"
"Username": "${EMAIL_SMTP_USERNAME}",
"Password": "${EMAIL_SMTP_PASSWORD}"
},
"FromAddress": "[email protected]",
"FromName": "Dental Care"
},
"VNPAY": {
"TmnCode": "UFVXRR9T",
"HashSecret": "N9UU3MI63OI2DLP3P7RBJGHB0KYSGZG1",
"TmnCode": "${VNPAY_TMNCODE}",
"HashSecret": "${VNPAY_HASHSECRET}",
"BaseUrl": "https://sandbox.vnpayment.vn/paymentv2/vpcpay.html",
"Version": "2.1.0",
"Command": "pay",
Expand All @@ -39,22 +39,22 @@
"MomoAPI": {
"MomoApiUrl": "https://test-payment.momo.vn/gw_payment/transactionProcessor",
"MomoApiUrlV2": "https://test-payment.momo.vn/v2/gateway/api/create",
"SecretKey": "K951B6PE1waDMi640xX08PD3vg6EkVlz",
"AccessKey": "F8BBA842ECF85",
"SecretKey": "${MOMO_API_SECRETKEY}",
"AccessKey": "${MOMO_API_ACCESSKEY}",
"ReturnUrl": "https://dentalcareplatform.azurewebsites.net/payment/ReturnUrl",
"IpnUrl": "https://dentalcareplatform.azurewebsites.net/payment/ReturnUrl",
"NotifyUrl": "https://dentalcareplatform.azurewebsites.net/Home/",
"PartnerCode": "MOMO",
"PartnerCode": "${MOMO_API_PARTNERCODE}",
"RequestType": "captureMoMoWallet",
"RequestTypeV2": "payWithCC",
"MomoApiRefundUrl": "https://test-payment.momo.vn/v2/gateway/api/refund",
"PublicKey": "F8BBA842ECF85"
"PublicKey": "${MOMO_API_PUBLICKEY}"
},
"ZeroBounce": {
"ApiKey": "6a65c9d8c090401db926f6fe785567e7"
"ApiKey": "${ZEROBOUNCE_APIKEY}"
},
"RedisConnection": {
"Configuration": "localhost:7165",
"Configuration": "",
"InstanceName": "DentalCare"
},
"profiles": {
Expand Down

0 comments on commit 542e0e8

Please sign in to comment.