---
# System prepended metadata

title: Cloud Function implementation by Terraform
tags: [olympus]

---

# Cloud Function implementation by Terraform

###### tags: `olympus`

## Firebase authentication

```mermaid
sequenceDiagram
autonumber
actor EndUser
EndUser ->> AppDataCF▶️: call
AppDataCF▶️ ->> AuthCF▶️: call
AuthCF▶️ ->> 🔥Firebase.auth: Request Authentication
🔥Firebase.auth ->> AuthCF▶️: ResponseToken
AuthCF▶️ ->> AppDataCF▶️: approve or not approve
Note right of AppDataCF▶️: Do or don't storage
```

## Task list
- [x] (AuthCF▶️) Verify firebase id token
```go=
client, err := app.Auth(ctx)
if err != nil {
        log.Fatalf("error getting Auth client: %v\n", err)
}

token, err := client.VerifyIDToken(ctx, idToken)
if err != nil {
        log.Fatalf("error verifying ID token: %v\n", err)
}

log.Printf("Verified ID token: %v\n", token)auth.go
```

- [ ] (AppDataCF▶️) given app data to store into firestore