Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user-facing view to fxa_oauth.clients #4623

Merged
merged 5 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions sql/moz-fx-data-shared-prod/accounts_db/dataset_metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
friendly_name: Firefox Accounts Databases production
description: |-
Views for accessing data extracted from Mozilla Accounts backend services databases.

Contains views to selected tables and columns from `accounts_db_external` dataset that are useful for analysis.
dataset_base_acl: view
user_facing: true
labels: {}
workgroup_access:
- role: roles/bigquery.dataViewer
members:
- workgroup:mozilla-confidential
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
friendly_name: Clients table from production fxa_oauth database
description: |-
An authorized view on top of the `accounts_db_external.fxa_oauth_clients_v1` table.
Contains mappings of oauth client ids to their names.

`id` column is converted from bytes to a hex string.

See https://mozilla.github.io/ecosystem-platform/reference/database-structure#database-fxa
labels:
authorized: true
workgroup_access:
- role: roles/bigquery.dataViewer
members:
- workgroup:mozilla-confidential
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE OR REPLACE VIEW
`moz-fx-data-shared-prod.accounts_db.fxa_oauth_clients`
AS
SELECT
TO_HEX(id) AS id,
Copy link
Contributor

Choose a reason for hiding this comment

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

My personal preference would be to convert all ID bytes columns to hex strings in the underlying ETLs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree, I plan to do that when I'm back in a week.

name,
createdAt,
FROM
`moz-fx-data-shared-prod.accounts_db_external.fxa_oauth_clients_v1`