A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
feat(age): verify Android age with Play Integrity (#3872)
Hampusec7a771bf2c1
diff --git a/Cargo.lock b/Cargo.lockindex e92f7f83f..6bbdfa6c4 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -1912,6 +1912,7 @@ dependencies = ["futures","hmac","moka",+ "reqwest","ring","scylla","serde",diff --git a/fluxer_admin/openapi-admin.json b/fluxer_admin/openapi-admin.jsonindex eb323a988..719340fcf 100644--- a/fluxer_admin/openapi-admin.json+++ b/fluxer_admin/openapi-admin.json@@ -26970,6 +26970,13 @@"APP_ATTEST_ATTESTATION_INVALID","APP_ATTEST_ASSERTION_INVALID","APP_ATTEST_REQUEST_INVALID",+ "PLAY_INTEGRITY_NOT_AVAILABLE",+ "PLAY_INTEGRITY_REQUEST_INVALID",+ "PLAY_INTEGRITY_CHALLENGE_INVALID",+ "PLAY_INTEGRITY_TOKEN_INVALID",+ "PLAY_INTEGRITY_APP_NOT_RECOGNIZED",+ "PLAY_INTEGRITY_DEVICE_NOT_TRUSTED",+ "PLAY_INTEGRITY_UNAVAILABLE","BOTS_CANNOT_CREATE_GUILDS","BOTS_CANNOT_SEND_FRIEND_REQUESTS","BOT_ALREADY_IN_GUILD",@@ -27353,6 +27360,13 @@"We couldn't confirm this device key.","We couldn't confirm this age check from your device.","This age check request isn't valid.",+ "Age checks from the Android app aren't available on this instance.",+ "This age check request isn't valid.",+ "This check has expired or was already used. Try again.",+ "We couldn't confirm this age check from your device. Try again.",+ "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "We couldn't connect to Google Play to check your age. Try again later.","Bots can't create communities.","Bots can't send friend requests.","This bot is already in the community.",diff --git a/fluxer_api/src/api/infrastructure/UsersServiceClient.ts b/fluxer_api/src/api/infrastructure/UsersServiceClient.tsindex bbabc5426..d2b2f575f 100644--- a/fluxer_api/src/api/infrastructure/UsersServiceClient.ts+++ b/fluxer_api/src/api/infrastructure/UsersServiceClient.ts@@ -42,6 +42,13 @@ export interface IUsersServiceClient {assertionBase64: string;clientDataBase64: string;}): Promise<AppAttestOutcome<AppAttestAgeAccepted>>;+ playIntegrityCreateChallenge(userId: UserID): Promise<PlayIntegrityOutcome<AppAttestChallengeIssued>>;+ playIntegritySubmitAge(params: {+ userId: UserID;+ packageName: string;+ integrityToken: string;+ clientDataBase64: string;+ }): Promise<PlayIntegrityOutcome<AppAttestAgeAccepted>>;}const APP_ATTEST_REJECTION_CODES = [@@ -58,6 +65,20 @@ export type AppAttestRejectionCode = (typeof APP_ATTEST_REJECTION_CODES)[number]export type AppAttestOutcome<T> = {ok: true; value: T} | {ok: false; code: AppAttestRejectionCode};+const PLAY_INTEGRITY_REJECTION_CODES = [+ 'not_configured',+ 'invalid_request',+ 'invalid_challenge',+ 'invalid_token',+ 'app_not_recognized',+ 'device_not_trusted',+ 'unavailable',+] as const;++export type PlayIntegrityRejectionCode = (typeof PLAY_INTEGRITY_REJECTION_CODES)[number];++export type PlayIntegrityOutcome<T> = {ok: true; value: T} | {ok: false; code: PlayIntegrityRejectionCode};+export interface AppAttestChallengeIssued {challenge: string;expires_at: string;@@ -98,6 +119,17 @@ type UsersServiceRequest =key_id: string;assertion_base64: string;client_data_base64: string;+ }+ | {+ op: 'PlayIntegrityCreateChallenge';+ user_id: string;+ }+ | {+ op: 'PlayIntegritySubmitAge';+ user_id: string;+ package_name: string;+ integrity_token: string;+ client_data_base64: string;};interface UserPartialsResponse {@@ -114,15 +146,18 @@ function isUserPartialsResponse(value: unknown): value is UserPartialsResponse {);}-function isAppAttestRejectionCode(value: unknown): value is AppAttestRejectionCode {- return typeof value === 'string' && (APP_ATTEST_REJECTION_CODES as ReadonlyArray<string>).includes(value);+function rejectionReader<C extends string>(variant: string, codes: ReadonlyArray<C>): (value: unknown) => C | null {+ return (value) => {+ if (!isJsonRecord(value)) return null;+ const rejected = value[variant];+ if (!isJsonRecord(rejected)) return null;+ const code = rejected.code;+ return codes.find((candidate) => candidate === code) ?? null;+ };}-function rejectedCode(value: unknown): AppAttestRejectionCode | null {- if (!isJsonRecord(value) || !isJsonRecord(value.AppAttestRejected)) return null;- const code = value.AppAttestRejected.code;- return isAppAttestRejectionCode(code) ? code : null;-}+const appAttestRejection = rejectionReader('AppAttestRejected', APP_ATTEST_REJECTION_CODES);+const playIntegrityRejection = rejectionReader('PlayIntegrityRejected', PLAY_INTEGRITY_REJECTION_CODES);function acceptChallenge(value: unknown): AppAttestChallengeIssued | null {if (!isJsonRecord(value) || !isJsonRecord(value.AppAttestChallenge)) return null;@@ -250,9 +285,10 @@ export class NatsUsersServiceClient implements IUsersServiceClient {userId: UserID,purpose: AppAttestChallengePurpose,): Promise<AppAttestOutcome<AppAttestChallengeIssued>> {- return this.appAttestRequest(+ return this.attestationRequest({op: 'AppAttestCreateChallenge', user_id: userId.toString(), purpose},acceptChallenge,+ appAttestRejection,);}@@ -262,7 +298,7 @@ export class NatsUsersServiceClient implements IUsersServiceClient {attestationBase64: string;challenge: string;}): Promise<AppAttestOutcome<true>> {- return this.appAttestRequest(+ return this.attestationRequest({op: 'AppAttestRegisterKey',user_id: params.userId.toString(),@@ -271,6 +307,7 @@ export class NatsUsersServiceClient implements IUsersServiceClient {challenge: params.challenge,},acceptKeyRegistered,+ appAttestRejection,);}@@ -280,7 +317,7 @@ export class NatsUsersServiceClient implements IUsersServiceClient {assertionBase64: string;clientDataBase64: string;}): Promise<AppAttestOutcome<AppAttestAgeAccepted>> {- return this.appAttestRequest(+ return this.attestationRequest({op: 'AppAttestSubmitAge',user_id: params.userId.toString(),@@ -289,21 +326,50 @@ export class NatsUsersServiceClient implements IUsersServiceClient {client_data_base64: params.clientDataBase64,},acceptAge,+ appAttestRejection,+ );+ }++ async playIntegrityCreateChallenge(userId: UserID): Promise<PlayIntegrityOutcome<AppAttestChallengeIssued>> {+ return this.attestationRequest(+ {op: 'PlayIntegrityCreateChallenge', user_id: userId.toString()},+ acceptChallenge,+ playIntegrityRejection,+ );+ }++ async playIntegritySubmitAge(params: {+ userId: UserID;+ packageName: string;+ integrityToken: string;+ clientDataBase64: string;+ }): Promise<PlayIntegrityOutcome<AppAttestAgeAccepted>> {+ return this.attestationRequest(+ {+ op: 'PlayIntegritySubmitAge',+ user_id: params.userId.toString(),+ package_name: params.packageName,+ integrity_token: params.integrityToken,+ client_data_base64: params.clientDataBase64,+ },+ acceptAge,+ playIntegrityRejection,);}- private async appAttestRequest<T>(+ private async attestationRequest<T, C extends string>(payload: UsersServiceRequest,accept: (value: unknown) => T | null,- ): Promise<AppAttestOutcome<T>> {+ reject: (value: unknown) => C | null,+ ): Promise<{ok: true; value: T} | {ok: false; code: C}> {const reply = await this.request(payload,- (value): value is unknown => rejectedCode(value) !== null || accept(value) !== null,+ (value): value is unknown => reject(value) !== null || accept(value) !== null,);- const code = rejectedCode(reply);+ const code = reject(reply);if (code !== null) return {ok: false, code};const accepted = accept(reply);- if (accepted === null) throw new Error('[users-service] invalid App Attest response payload');+ if (accepted === null) throw new Error('[users-service] invalid age assurance response payload');return {ok: true, value: accepted};}diff --git a/fluxer_api/src/api/middleware/DateOfBirthGateMiddleware.ts b/fluxer_api/src/api/middleware/DateOfBirthGateMiddleware.tsindex f8be09a14..f4d97f088 100644--- a/fluxer_api/src/api/middleware/DateOfBirthGateMiddleware.ts+++ b/fluxer_api/src/api/middleware/DateOfBirthGateMiddleware.ts@@ -16,7 +16,8 @@ export const DATE_OF_BIRTH_ALLOWLIST: ReadonlyArray<{method: string; path: RegEx{method: 'POST', path: /^\/users\/@me\/disable$/},{method: 'POST', path: /^\/users\/@me\/terms-acceptance$/},{method: 'POST', path: /^\/users\/@me\/app-attest\/(challenge|keys)$/},- {method: 'POST', path: /^\/users\/@me\/age-assurance$/},+ {method: 'POST', path: /^\/users\/@me\/play-integrity\/challenge$/},+ {method: 'POST', path: /^\/users\/@me\/age-assurance(\/play-integrity)?$/},{method: 'GET', path: /^\/users\/@me\/harvest(\/[^/]+)*$/},{method: 'POST', path: /^\/users\/@me\/harvest(\/[^/]+)*$/},{method: 'GET', path: /^\/experiments$/},diff --git a/fluxer_api/src/api/openapi/openapi.json b/fluxer_api/src/api/openapi/openapi.jsonindex 085f0ec27..fd5a9e9d9 100644--- a/fluxer_api/src/api/openapi/openapi.json+++ b/fluxer_api/src/api/openapi/openapi.json@@ -17895,6 +17895,71 @@}}},+ "/users/@me/age-assurance/play-integrity": {+ "post": {+ "operationId": "submit_play_integrity_age_assurance",+ "summary": "Submit Play age range",+ "tags": ["Users"],+ "responses": {+ "200": {+ "description": "Success",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgeAssuranceSubmitResponse"}}}+ },+ "400": {+ "description": "Bad Request - The request was malformed or contained invalid data",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}+ },+ "401": {+ "description": "Unauthorized - Authentication is required or the token is invalid",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}+ },+ "403": {+ "description": "Forbidden - You do not have permission to perform this action",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}+ },+ "404": {+ "description": "Not Found - The requested resource was not found",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}+ },+ "429": {+ "description": "Too Many Requests - You are being rate limited",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ThrottledError"}}},+ "headers": {+ "Retry-After": {+ "description": "Number of seconds to wait before retrying (only on 429)",+ "schema": {"type": "integer"}+ },+ "X-RateLimit-Limit": {+ "description": "The number of requests that can be made in the current window",+ "schema": {"type": "integer"}+ },+ "X-RateLimit-Remaining": {+ "description": "The number of remaining requests that can be made",+ "schema": {"type": "integer"}+ },+ "X-RateLimit-Reset": {+ "description": "Unix timestamp when the rate limit resets",+ "schema": {"type": "integer"}+ }+ }+ },+ "500": {+ "description": "Internal Server Error - An unexpected error occurred",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}+ },+ "503": {+ "description": "Service Unavailable - The request could not be completed right now",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}+ }+ },+ "description": "Submits the age range that the Google Play Age Signals API reported, bound to a standard Play Integrity token. client_data holds the exact JSON bytes the app hashed, with the challenge from the Play Integrity challenge endpoint, age_lower, age_upper and age_range_source. The token must be requested with requestHash set to the SHA-256 of those bytes as unpadded base64url. Fluxer checks the token with Google Play and works out the age floor from the range: adult when age_lower is 18, minor when age_lower is 13 or more, and under_minimum otherwise. The newest accepted floor replaces the stored one, as with the iOS age check. Returns PLAY_INTEGRITY_APP_NOT_RECOGNIZED when the app was not installed from Google Play, and PLAY_INTEGRITY_DEVICE_NOT_TRUSTED when the device fails the Play device check. Returns PLAY_INTEGRITY_UNAVAILABLE with status 503 when Google Play could not be asked, in which case the app should try again later with a new challenge. Returns PLAY_INTEGRITY_NOT_AVAILABLE with status 404 when this instance does not accept Play Integrity.",+ "security": [{"sessionToken": []}],+ "requestBody": {+ "required": true,+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PlayIntegrityAgeSubmitRequest"}}}+ }+ }+ },"/users/@me/app-attest/challenge": {"post": {"operationId": "create_app_attest_challenge",@@ -23451,6 +23516,63 @@}}},+ "/users/@me/play-integrity/challenge": {+ "post": {+ "operationId": "create_play_integrity_challenge",+ "summary": "Create Play Integrity challenge",+ "tags": ["Users"],+ "responses": {+ "200": {+ "description": "Success",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AppAttestChallengeResponse"}}}+ },+ "400": {+ "description": "Bad Request - The request was malformed or contained invalid data",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}+ },+ "401": {+ "description": "Unauthorized - Authentication is required or the token is invalid",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}+ },+ "403": {+ "description": "Forbidden - You do not have permission to perform this action",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}+ },+ "404": {+ "description": "Not Found - The requested resource was not found",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}+ },+ "429": {+ "description": "Too Many Requests - You are being rate limited",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ThrottledError"}}},+ "headers": {+ "Retry-After": {+ "description": "Number of seconds to wait before retrying (only on 429)",+ "schema": {"type": "integer"}+ },+ "X-RateLimit-Limit": {+ "description": "The number of requests that can be made in the current window",+ "schema": {"type": "integer"}+ },+ "X-RateLimit-Remaining": {+ "description": "The number of remaining requests that can be made",+ "schema": {"type": "integer"}+ },+ "X-RateLimit-Reset": {+ "description": "Unix timestamp when the rate limit resets",+ "schema": {"type": "integer"}+ }+ }+ },+ "500": {+ "description": "Internal Server Error - An unexpected error occurred",+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}+ }+ },+ "description": "Creates a single use challenge for the Android app, valid for 5 minutes. Put it in client_data before submitting an age range with a Play Integrity token. Returns PLAY_INTEGRITY_NOT_AVAILABLE with status 404 when this instance does not accept Play Integrity.",+ "security": [{"sessionToken": []}]+ }+ },"/users/@me/preload-messages": {"post": {"operationId": "preload_messages_for_channels",@@ -29600,6 +29722,20 @@"additionalProperties": {"anyOf": [{"$ref": "#/components/schemas/MessageResponseSchema"}, {"type": "null"}]},"description": "A map of channel IDs to the latest message in each channel"},+ "AppAttestChallengeResponse": {+ "type": "object",+ "properties": {+ "challenge": {"type": "string", "description": "Single use challenge, 32 bytes as unpadded base64url"},+ "expires_at": {+ "type": "string",+ "format": "date-time",+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",+ "description": "When the challenge stops working"+ }+ },+ "required": ["challenge", "expires_at"],+ "additionalProperties": false+ },"PasswordChangeVerifyRequest": {"type": "object","properties": {@@ -31879,18 +32015,35 @@},"required": ["purpose"]},- "AppAttestChallengeResponse": {+ "PlayIntegrityAgeSubmitRequest": {"type": "object","properties": {- "challenge": {"type": "string", "description": "Single use challenge, 32 bytes as unpadded base64url"},- "expires_at": {+ "package_name": {"type": "string",- "format": "date-time",- "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",- "description": "When the challenge stops working"+ "maxLength": 255,+ "pattern": "^[A-Za-z][A-Za-z0-9_]*(\\.[A-Za-z][A-Za-z0-9_]*)+$",+ "description": "Package name of the Android app that asked for the integrity token, such as com.fluxer"+ },+ "integrity_token": {+ "type": "string",+ "minLength": 1,+ "maxLength": 16384,+ "pattern": "^[\\x21\\x23-\\x5b\\x5d-\\x7e]+$",+ "description": "Token from a standard Play Integrity request, made with requestHash set to the SHA-256 of client_data as unpadded base64url"+ },+ "client_data": {+ "type": "string",+ "minLength": 4,+ "maxLength": 1368,+ "description": "The exact UTF-8 JSON bytes the app hashed, as standard base64 on one line with no line breaks (Base64.NO_WRAP on Android). The JSON holds challenge, age_lower, age_upper and age_range_source"}},- "required": ["challenge", "expires_at"],+ "required": ["package_name", "integrity_token", "client_data"]+ },+ "AgeAssuranceSubmitResponse": {+ "type": "object",+ "properties": {"age_floor": {"$ref": "#/components/schemas/AttestedAgeFloorSchema"}},+ "required": ["age_floor"],"additionalProperties": false},"AgeAssuranceSubmitRequest": {@@ -31917,12 +32070,6 @@},"required": ["key_id", "assertion", "client_data"]},- "AgeAssuranceSubmitResponse": {- "type": "object",- "properties": {"age_floor": {"$ref": "#/components/schemas/AttestedAgeFloorSchema"}},- "required": ["age_floor"],- "additionalProperties": false- },"UserUpdateWithVerificationRequest": {"type": "object","properties": {@@ -46790,6 +46937,13 @@"APP_ATTEST_ATTESTATION_INVALID","APP_ATTEST_ASSERTION_INVALID","APP_ATTEST_REQUEST_INVALID",+ "PLAY_INTEGRITY_NOT_AVAILABLE",+ "PLAY_INTEGRITY_REQUEST_INVALID",+ "PLAY_INTEGRITY_CHALLENGE_INVALID",+ "PLAY_INTEGRITY_TOKEN_INVALID",+ "PLAY_INTEGRITY_APP_NOT_RECOGNIZED",+ "PLAY_INTEGRITY_DEVICE_NOT_TRUSTED",+ "PLAY_INTEGRITY_UNAVAILABLE","BOTS_CANNOT_CREATE_GUILDS","BOTS_CANNOT_SEND_FRIEND_REQUESTS","BOT_ALREADY_IN_GUILD",@@ -47173,6 +47327,13 @@"We couldn't confirm this device key.","We couldn't confirm this age check from your device.","This age check request isn't valid.",+ "Age checks from the Android app aren't available on this instance.",+ "This age check request isn't valid.",+ "This check has expired or was already used. Try again.",+ "We couldn't confirm this age check from your device. Try again.",+ "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "We couldn't connect to Google Play to check your age. Try again later.","Bots can't create communities.","Bots can't send friend requests.","This bot is already in the community.",diff --git a/fluxer_api/src/api/rate_limit_configs/UserRateLimitConfig.ts b/fluxer_api/src/api/rate_limit_configs/UserRateLimitConfig.tsindex be2b8d45c..cbdaf42bd 100644--- a/fluxer_api/src/api/rate_limit_configs/UserRateLimitConfig.ts+++ b/fluxer_api/src/api/rate_limit_configs/UserRateLimitConfig.ts@@ -268,6 +268,14 @@ export const UserRateLimitConfigs = {bucket: 'user:age_assurance:submit',config: {limit: 6, windowMs: ms('1 minute')},} as RouteRateLimitConfig,+ USER_PLAY_INTEGRITY_CHALLENGE: {+ bucket: 'user:play_integrity:challenge',+ config: {limit: 10, windowMs: ms('1 minute')},+ } as RouteRateLimitConfig,+ USER_PLAY_INTEGRITY_AGE_SUBMIT: {+ bucket: 'user:play_integrity:age_submit',+ config: {limit: 10, windowMs: ms('1 hour')},+ } as RouteRateLimitConfig,USER_DATE_OF_BIRTH: {bucket: 'user:date_of_birth',config: {limit: 5, windowMs: ms('1 hour')},diff --git a/fluxer_api/src/api/test/Setup.ts b/fluxer_api/src/api/test/Setup.tsindex 1ac9cca7e..f30d20ff7 100644--- a/fluxer_api/src/api/test/Setup.ts+++ b/fluxer_api/src/api/test/Setup.ts@@ -16,6 +16,7 @@ import type {AppAttestChallengeIssued,AppAttestOutcome,IUsersServiceClient,+ PlayIntegrityOutcome,} from '@app/api/infrastructure/UsersServiceClient';import {setInjectedUsersServiceClient} from '@app/api/infrastructure/UsersServiceClient';import {initializeLogger} from '@app/api/Logger';@@ -129,6 +130,14 @@ class RepositoryBackedUsersServiceClient implements IUsersServiceClient {async appAttestSubmitAge(): Promise<AppAttestOutcome<AppAttestAgeAccepted>> {return {ok: false, code: 'not_configured'};}++ async playIntegrityCreateChallenge(): Promise<PlayIntegrityOutcome<AppAttestChallengeIssued>> {+ return {ok: false, code: 'not_configured'};+ }++ async playIntegritySubmitAge(): Promise<PlayIntegrityOutcome<AppAttestAgeAccepted>> {+ return {ok: false, code: 'not_configured'};+ }}setDefaultTestEnv();diff --git a/fluxer_api/src/api/user/AgeAssurance.ts b/fluxer_api/src/api/user/AgeAssurance.tsindex 4d14502ac..7de076281 100644--- a/fluxer_api/src/api/user/AgeAssurance.ts+++ b/fluxer_api/src/api/user/AgeAssurance.ts@@ -4,9 +4,12 @@ import type {ApiContext} from '@app/api/ApiContext';import type {UserID} from '@app/api/BrandedTypes';import {executeConditional, fetchMany} from '@app/api/database/CassandraQueryExecution';import {+ type AppAttestAgeAccepted,type AppAttestOutcome,type AppAttestRejectionCode,createUsersServiceClient,+ type PlayIntegrityOutcome,+ type PlayIntegrityRejectionCode,} from '@app/api/infrastructure/UsersServiceClient';import type {User} from '@app/api/models/User';import {AppAttestKeyLookup, AppAttestKeys} from '@app/api/Tables';@@ -21,11 +24,19 @@ import {AppAttestKeyInUseError} from '@fluxer/errors/src/domains/user/AppAttestKimport {AppAttestKeyNotRegisteredError} from '@fluxer/errors/src/domains/user/AppAttestKeyNotRegisteredError';import {AppAttestNotAvailableError} from '@fluxer/errors/src/domains/user/AppAttestNotAvailableError';import {AppAttestRequestInvalidError} from '@fluxer/errors/src/domains/user/AppAttestRequestInvalidError';+import {PlayIntegrityAppNotRecognizedError} from '@fluxer/errors/src/domains/user/PlayIntegrityAppNotRecognizedError';+import {PlayIntegrityChallengeInvalidError} from '@fluxer/errors/src/domains/user/PlayIntegrityChallengeInvalidError';+import {PlayIntegrityDeviceNotTrustedError} from '@fluxer/errors/src/domains/user/PlayIntegrityDeviceNotTrustedError';+import {PlayIntegrityNotAvailableError} from '@fluxer/errors/src/domains/user/PlayIntegrityNotAvailableError';+import {PlayIntegrityRequestInvalidError} from '@fluxer/errors/src/domains/user/PlayIntegrityRequestInvalidError';+import {PlayIntegrityTokenInvalidError} from '@fluxer/errors/src/domains/user/PlayIntegrityTokenInvalidError';+import {PlayIntegrityUnavailableError} from '@fluxer/errors/src/domains/user/PlayIntegrityUnavailableError';import type {AgeAssuranceSubmitRequest,AgeAssuranceSubmitResponse,AppAttestChallengeResponse,AppAttestKeyRegisterRequest,+ PlayIntegrityAgeSubmitRequest,} from '@fluxer/schema/src/domains/user/AgeAssuranceSchemas';const FETCH_APP_ATTEST_KEYS_FOR_USER_CQL = AppAttestKeys.selectCql({@@ -57,6 +68,30 @@ function unwrap<T>(outcome: AppAttestOutcome<T>): T {return outcome.value;}+function playIntegrityRejectionError(code: PlayIntegrityRejectionCode): Error {+ switch (code) {+ case 'not_configured':+ return new PlayIntegrityNotAvailableError();+ case 'invalid_request':+ return new PlayIntegrityRequestInvalidError();+ case 'invalid_challenge':+ return new PlayIntegrityChallengeInvalidError();+ case 'invalid_token':+ return new PlayIntegrityTokenInvalidError();+ case 'app_not_recognized':+ return new PlayIntegrityAppNotRecognizedError();+ case 'device_not_trusted':+ return new PlayIntegrityDeviceNotTrustedError();+ case 'unavailable':+ return new PlayIntegrityUnavailableError();+ }+}++function unwrapPlayIntegrity<T>(outcome: PlayIntegrityOutcome<T>): T {+ if (!outcome.ok) throw playIntegrityRejectionError(outcome.code);+ return outcome.value;+}+export async function createAppAttestChallenge(userId: UserID,purpose: AppAttestChallengePurpose,@@ -88,6 +123,34 @@ export async function submitAttestedAge(clientDataBase64: request.client_data,}),);+ return applyAttestedAge(ctx, user, accepted);+}++export async function createPlayIntegrityChallenge(userId: UserID): Promise<AppAttestChallengeResponse> {+ return unwrapPlayIntegrity(await createUsersServiceClient().playIntegrityCreateChallenge(userId));+}++export async function submitPlayIntegrityAge(+ ctx: ApiContext,+ user: User,+ request: PlayIntegrityAgeSubmitRequest,+): Promise<AgeAssuranceSubmitResponse> {+ const accepted = unwrapPlayIntegrity(+ await createUsersServiceClient().playIntegritySubmitAge({+ userId: user.id,+ packageName: request.package_name,+ integrityToken: request.integrity_token,+ clientDataBase64: request.client_data,+ }),+ );+ return applyAttestedAge(ctx, user, accepted);+}++async function applyAttestedAge(+ ctx: ApiContext,+ user: User,+ accepted: AppAttestAgeAccepted,+): Promise<AgeAssuranceSubmitResponse> {const attestedAt = new Date(accepted.attested_at);if (user.ageAttestedAt !== null && user.ageAttestedAt.getTime() > attestedAt.getTime()) {return {age_floor: accepted.age_floor};diff --git a/fluxer_api/src/api/user/controllers/UserAgeAssuranceController.ts b/fluxer_api/src/api/user/controllers/UserAgeAssuranceController.tsindex 1f73b6c7f..585e6ff96 100644--- a/fluxer_api/src/api/user/controllers/UserAgeAssuranceController.ts+++ b/fluxer_api/src/api/user/controllers/UserAgeAssuranceController.ts@@ -5,7 +5,13 @@ import {RateLimitMiddleware} from '@app/api/middleware/RateLimitMiddleware';import {OpenAPI} from '@app/api/middleware/ResponseTypeMiddleware';import {RateLimitConfigs} from '@app/api/RateLimitConfig';import type {HonoApp} from '@app/api/types/HonoEnv';-import {createAppAttestChallenge, registerAppAttestKey, submitAttestedAge} from '@app/api/user/AgeAssurance';+import {+ createAppAttestChallenge,+ createPlayIntegrityChallenge,+ registerAppAttestKey,+ submitAttestedAge,+ submitPlayIntegrityAge,+} from '@app/api/user/AgeAssurance';import {Validator} from '@app/api/Validator';import {AgeAssuranceSubmitRequest,@@ -13,6 +19,7 @@ import {AppAttestChallengeRequest,AppAttestChallengeResponse,AppAttestKeyRegisterRequest,+ PlayIntegrityAgeSubmitRequest,} from '@fluxer/schema/src/domains/user/AgeAssuranceSchemas';export function UserAgeAssuranceController(app: HonoApp) {@@ -80,4 +87,45 @@ export function UserAgeAssuranceController(app: HonoApp) {return ctx.json(await submitAttestedAge(ctx.get('apiContext'), ctx.get('user'), ctx.req.valid('json')));},);+ app.post(+ '/users/@me/play-integrity/challenge',+ RateLimitMiddleware(RateLimitConfigs.USER_PLAY_INTEGRITY_CHALLENGE),+ LoginRequired,+ DefaultUserOnly,+ OpenAPI({+ operationId: 'create_play_integrity_challenge',+ summary: 'Create Play Integrity challenge',+ responseSchema: AppAttestChallengeResponse,+ statusCode: 200,+ errorStatusCodes: [404],+ security: ['bearerToken', 'sessionToken'],+ tags: ['Users'],+ description:+ 'Creates a single use challenge for the Android app, valid for 5 minutes. Put it in client_data before submitting an age range with a Play Integrity token. Returns PLAY_INTEGRITY_NOT_AVAILABLE with status 404 when this instance does not accept Play Integrity.',+ }),+ async (ctx) => {+ return ctx.json(await createPlayIntegrityChallenge(ctx.get('user').id));+ },+ );+ app.post(+ '/users/@me/age-assurance/play-integrity',+ RateLimitMiddleware(RateLimitConfigs.USER_PLAY_INTEGRITY_AGE_SUBMIT),+ LoginRequired,+ DefaultUserOnly,+ Validator('json', PlayIntegrityAgeSubmitRequest),+ OpenAPI({+ operationId: 'submit_play_integrity_age_assurance',+ summary: 'Submit Play age range',+ responseSchema: AgeAssuranceSubmitResponse,+ statusCode: 200,+ errorStatusCodes: [404, 503],+ security: ['bearerToken', 'sessionToken'],+ tags: ['Users'],+ description:+ 'Submits the age range that the Google Play Age Signals API reported, bound to a standard Play Integrity token. client_data holds the exact JSON bytes the app hashed, with the challenge from the Play Integrity challenge endpoint, age_lower, age_upper and age_range_source. The token must be requested with requestHash set to the SHA-256 of those bytes as unpadded base64url. Fluxer checks the token with Google Play and works out the age floor from the range: adult when age_lower is 18, minor when age_lower is 13 or more, and under_minimum otherwise. The newest accepted floor replaces the stored one, as with the iOS age check. Returns PLAY_INTEGRITY_APP_NOT_RECOGNIZED when the app was not installed from Google Play, and PLAY_INTEGRITY_DEVICE_NOT_TRUSTED when the device fails the Play device check. Returns PLAY_INTEGRITY_UNAVAILABLE with status 503 when Google Play could not be asked, in which case the app should try again later with a new challenge. Returns PLAY_INTEGRITY_NOT_AVAILABLE with status 404 when this instance does not accept Play Integrity.',+ }),+ async (ctx) => {+ return ctx.json(await submitPlayIntegrityAge(ctx.get('apiContext'), ctx.get('user'), ctx.req.valid('json')));+ },+ );}diff --git a/fluxer_api/src/api/user/tests/AgeAssuranceSubmit.test.ts b/fluxer_api/src/api/user/tests/AgeAssuranceSubmit.test.tsindex f88e5a62a..f1772504f 100644--- a/fluxer_api/src/api/user/tests/AgeAssuranceSubmit.test.ts+++ b/fluxer_api/src/api/user/tests/AgeAssuranceSubmit.test.ts@@ -33,6 +33,8 @@ function acceptingClient(base: IUsersServiceClient, floor: AttestedAgeFloor, attok: true,value: {age_floor: floor, attested_at: attestedAt.toISOString()},}),+ playIntegrityCreateChallenge: (userId) => base.playIntegrityCreateChallenge(userId),+ playIntegritySubmitAge: (params) => base.playIntegritySubmitAge(params),};}diff --git a/fluxer_api/src/api/user/tests/DateOfBirthStep.test.ts b/fluxer_api/src/api/user/tests/DateOfBirthStep.test.tsindex b576e69d0..e418c28e7 100644--- a/fluxer_api/src/api/user/tests/DateOfBirthStep.test.ts+++ b/fluxer_api/src/api/user/tests/DateOfBirthStep.test.ts@@ -299,8 +299,10 @@ describe('Date of birth gate route coverage', () => {'POST /users/@me/sudo/email-code','POST /users/@me/sudo/webauthn/authentication-options','POST /users/@me/age-assurance',+ 'POST /users/@me/age-assurance/play-integrity','POST /users/@me/app-attest/challenge','POST /users/@me/app-attest/keys',+ 'POST /users/@me/play-integrity/challenge','POST /users/@me/terms-acceptance','PUT /users/@me/date-of-birth',].sort(),diff --git a/fluxer_docs/src/content/docs/operator/environment.mdx b/fluxer_docs/src/content/docs/operator/environment.mdxindex 44d8871f2..f3442701f 100644--- a/fluxer_docs/src/content/docs/operator/environment.mdx+++ b/fluxer_docs/src/content/docs/operator/environment.mdx@@ -1272,6 +1272,22 @@ The iOS apps whose age reports the users service accepts through Apple App AttesWhether the users service also accepts App Attest keys from development builds of the apps in `FLUXER_APP_ATTEST_APP_IDS`. Use `true` or `false`. When it's empty, it uses `false`, so only App Store, TestFlight and other production builds are accepted. With rexctl, use `rexctl config set FLUXER_APP_ATTEST_ALLOW_DEVELOPMENT`.+### `FLUXER_PLAY_INTEGRITY_PACKAGE_NAMES`++The Android apps whose age reports the users service accepts through the Google Play Integrity API, separated by commas, such as `com.example.app`. When it's empty, Play Integrity is off and its API endpoints respond that the feature isn't available. When it's set, `FLUXER_PLAY_INTEGRITY_CERT_SHA256` and `FLUXER_PLAY_INTEGRITY_SERVICE_ACCOUNT_JSON_PATH` are required, and the users service doesn't start without them. With rexctl, use `rexctl config set FLUXER_PLAY_INTEGRITY_PACKAGE_NAMES`.++### `FLUXER_PLAY_INTEGRITY_CERT_SHA256`++The SHA-256 fingerprints of the app signing certificates that Google Play uses for the apps in `FLUXER_PLAY_INTEGRITY_PACKAGE_NAMES`, separated by commas. Each entry is the hex fingerprint the Play Console shows under app signing, with or without colons, or the same digest as base64url. With rexctl, use `rexctl config set FLUXER_PLAY_INTEGRITY_CERT_SHA256`.++### `FLUXER_PLAY_INTEGRITY_SERVICE_ACCOUNT_JSON_PATH`++The path to a Google Cloud service account JSON key file inside the users container. The users service uses it to ask Google Play to decode integrity tokens. The service account must belong to the Cloud project linked to the apps in the Play Console. With rexctl, use `rexctl config set FLUXER_PLAY_INTEGRITY_SERVICE_ACCOUNT_JSON_PATH`.++### `FLUXER_PLAY_INTEGRITY_DEVICE_INTEGRITY`++The device check an Android device must pass. Use `device` to need `MEETS_DEVICE_INTEGRITY`, or `strong` to need `MEETS_STRONG_INTEGRITY`, which you must turn on in the Play Console first. When it's empty, it uses `device`. With rexctl, use `rexctl config set FLUXER_PLAY_INTEGRITY_DEVICE_INTEGRITY`.+### `FLUXER_ACCOUNT_IDENTITY`How people sign in on a new instance. Use `username` or `email`. Fluxer uses it only on the first start with no saved sign-in method. When it's empty, Fluxer uses `email` if email delivery is set up and `username` otherwise. When `FLUXER_INSTANCE_SETUP_CONFIGURED` is `true` or any account exists, Fluxer uses email sign-in with random tags and ignores this. Otherwise the setup wizard asks again, and its answer replaces this value. With rexctl, use `rexctl config set FLUXER_ACCOUNT_IDENTITY`.diff --git a/fluxer_rexctl/internal/instance/envvars.go b/fluxer_rexctl/internal/instance/envvars.goindex fba9aa6bb..9bbb40c71 100644--- a/fluxer_rexctl/internal/instance/envvars.go+++ b/fluxer_rexctl/internal/instance/envvars.go@@ -333,6 +333,10 @@ var envVars = []envVar{{"FLUXER_INSTANCE_SETUP_CONFIGURED", "instance", "Whether a new instance starts as already set up. Use `true` or `false`. With `true`, the setup wizard is skipped and registration opens without making the first account an admin. Once a setup state is saved, this has no effect. When it's empty, Fluxer uses `false`."},{"FLUXER_APP_ATTEST_APP_IDS", "instance", "The iOS apps whose age reports the users service accepts through Apple App Attest, separated by commas. Each entry is a team ID, a dot and a bundle ID, such as `ABCDE12345.com.example.app`. When it's empty, App Attest is off and its API endpoints respond that the feature isn't available. The users service doesn't start when an entry isn't in that form."},{"FLUXER_APP_ATTEST_ALLOW_DEVELOPMENT", "instance", "Whether the users service also accepts App Attest keys from development builds of the apps in FLUXER_APP_ATTEST_APP_IDS. Use `true` or `false`. When it's empty, it uses `false`, so only App Store, TestFlight and other production builds are accepted."},+ {"FLUXER_PLAY_INTEGRITY_PACKAGE_NAMES", "instance", "The Android apps whose age reports the users service accepts through the Google Play Integrity API, separated by commas, such as `com.example.app`. When it's empty, Play Integrity is off and its API endpoints respond that the feature isn't available. When it's set, FLUXER_PLAY_INTEGRITY_CERT_SHA256 and FLUXER_PLAY_INTEGRITY_SERVICE_ACCOUNT_JSON_PATH are required, and the users service doesn't start without them."},+ {"FLUXER_PLAY_INTEGRITY_CERT_SHA256", "instance", "The SHA-256 fingerprints of the app signing certificates that Google Play uses for the apps in FLUXER_PLAY_INTEGRITY_PACKAGE_NAMES, separated by commas. Each entry is the hex fingerprint the Play Console shows under app signing, with or without colons, or the same digest as base64url."},+ {"FLUXER_PLAY_INTEGRITY_SERVICE_ACCOUNT_JSON_PATH", "instance", "The path to a Google Cloud service account JSON key file inside the users container. The users service uses it to ask Google Play to decode integrity tokens. The service account must belong to the Cloud project linked to the apps in the Play Console."},+ {"FLUXER_PLAY_INTEGRITY_DEVICE_INTEGRITY", "instance", "The device check an Android device must pass. Use `device` to need MEETS_DEVICE_INTEGRITY, or `strong` to need MEETS_STRONG_INTEGRITY, which you must turn on in the Play Console first. When it's empty, it uses `device`."},{"FLUXER_ACCOUNT_IDENTITY", "instance", "How people sign in on a new instance. Use `username` or `email`. Fluxer uses it only on the first start with no saved sign-in method. When it's empty, Fluxer uses `email` if email delivery is set up and `username` otherwise. When FLUXER_INSTANCE_SETUP_CONFIGURED is `true` or any account exists, Fluxer uses email sign-in with random tags and ignores this. Otherwise the setup wizard asks again, and its answer replaces this value."},{"FLUXER_TAG_STYLE", "instance", "How usernames are tagged on a new instance that signs in by email. Use `none` for unique usernames with no tag or `random` for a random tag on every account. Username sign-in always uses `none`. Fluxer reads this setting only on the first start. When it's empty, Fluxer uses `none`. When FLUXER_INSTANCE_SETUP_CONFIGURED is `true` or any account exists, Fluxer uses random tags and ignores this. Otherwise the setup wizard asks again, and its answer replaces this value."},{"FLUXER_AUTO_JOIN_INVITE_CODE", "instance", "One or more invite codes, separated by commas or spaces. A new account that signs up without an invite of its own joins the communities these invites lead to."},diff --git a/fluxer_rexctl/internal/instance/shipped.json b/fluxer_rexctl/internal/instance/shipped.jsonindex d3d969155..72de127d1 100644--- a/fluxer_rexctl/internal/instance/shipped.json+++ b/fluxer_rexctl/internal/instance/shipped.json@@ -99,6 +99,7 @@"d3a01fb8fe168f8690ea3beba3c24320ad66d47a7d6986a1a80d68b0c31aa969","d6a68661ec5f33dbbd38f11218e9df7a63186cb49a1fe90652e12918de09f7d2","daaf60c750e57fcac9a5048e3c9d95dc96300f9dc16e729ff4ff528efeeb35f7",+ "dae1c664c98da3c7d0215b91b79a5050a62ea904ec35ac0bdd781e28cce51afa","dba04bd033c9db80c81aebe62473395306060e31806f21e069dd721471e63c30","dec97741c7d53dd2ea7eb8ea6696a69bf29f4999b8c6d87b726f9eba701a365f","dee3fc395dfbf9b8591e8a3d150c0ec0a03d4b76f1a7cd4a4314bf4c412c29f1",@@ -185,6 +186,7 @@"498d3c487cf0adc20468bf318d7ef97eb1fdac9d27b2e6a1ebb2cbc5b5cb384a","4c060846e5211265979537e4ff9058d52f7e6e5cbfa262c4533dd754e0d88cf6","4f39101a2c6a2d7bc84a5306568bc969b173b5efd87e18c89a63d62e826b2056",+ "51e3cfb1e62e46bdbde021017dd26acb462cffcde72cd33bea78cb334f2adea9","52b2532c0bd9f83292fbedd72aeef152fa1ae9a956b7822df3f5b7d271db2452","52d5265445c53eae652ce6de2edff3239b9c5fb618e9619cf87656eaea97d8d5","5326ddf97e15832ede8b81f35806771a8d6266694090c30d5f6785ad41bb3ea9",diff --git a/fluxer_rexctl/internal/stack/files/.env.example b/fluxer_rexctl/internal/stack/files/.env.exampleindex c039988b7..c9396b675 100644--- a/fluxer_rexctl/internal/stack/files/.env.example+++ b/fluxer_rexctl/internal/stack/files/.env.example@@ -1853,6 +1853,36 @@ FLUXER_VAPID_PRIVATE_KEY=# rexctl: rexctl config set FLUXER_APP_ATTEST_ALLOW_DEVELOPMENT# FLUXER_APP_ATTEST_ALLOW_DEVELOPMENT=+# The Android apps whose age reports the users service accepts through the+# Google Play Integrity API, separated by commas, such as com.example.app.+# When it's empty, Play Integrity is off and its API endpoints respond that+# the feature isn't available. When it's set,+# FLUXER_PLAY_INTEGRITY_CERT_SHA256 and+# FLUXER_PLAY_INTEGRITY_SERVICE_ACCOUNT_JSON_PATH are required, and the users+# service doesn't start without them.+# rexctl: rexctl config set FLUXER_PLAY_INTEGRITY_PACKAGE_NAMES+# FLUXER_PLAY_INTEGRITY_PACKAGE_NAMES=++# The SHA-256 fingerprints of the app signing certificates that Google Play+# uses for the apps in FLUXER_PLAY_INTEGRITY_PACKAGE_NAMES, separated by+# commas. Each entry is the hex fingerprint the Play Console shows under app+# signing, with or without colons, or the same digest as base64url.+# rexctl: rexctl config set FLUXER_PLAY_INTEGRITY_CERT_SHA256+# FLUXER_PLAY_INTEGRITY_CERT_SHA256=++# The path to a Google Cloud service account JSON key file inside the users+# container. The users service uses it to ask Google Play to decode integrity+# tokens. The service account must belong to the Cloud project linked to the+# apps in the Play Console.+# rexctl: rexctl config set FLUXER_PLAY_INTEGRITY_SERVICE_ACCOUNT_JSON_PATH+# FLUXER_PLAY_INTEGRITY_SERVICE_ACCOUNT_JSON_PATH=++# The device check an Android device must pass. Use device to need+# MEETS_DEVICE_INTEGRITY, or strong to need MEETS_STRONG_INTEGRITY, which you+# must turn on in the Play Console first. When it's empty, it uses device.+# rexctl: rexctl config set FLUXER_PLAY_INTEGRITY_DEVICE_INTEGRITY+# FLUXER_PLAY_INTEGRITY_DEVICE_INTEGRITY=+# How people sign in on a new instance. Use username or email. Fluxer uses it# only on the first start with no saved sign-in method. When it's empty,# Fluxer uses email if email delivery is set up and username otherwise. Whendiff --git a/fluxer_rexctl/internal/stack/files/docker-compose.yml b/fluxer_rexctl/internal/stack/files/docker-compose.ymlindex 87872dca8..58f95eda4 100644--- a/fluxer_rexctl/internal/stack/files/docker-compose.yml+++ b/fluxer_rexctl/internal/stack/files/docker-compose.yml@@ -205,6 +205,10 @@ x-fluxer-env: &fluxer-envFLUXER_APP_ATTEST_APP_IDS: ${FLUXER_APP_ATTEST_APP_IDS:-}FLUXER_APP_ATTEST_ALLOW_DEVELOPMENT: ${FLUXER_APP_ATTEST_ALLOW_DEVELOPMENT:-}+ FLUXER_PLAY_INTEGRITY_PACKAGE_NAMES: ${FLUXER_PLAY_INTEGRITY_PACKAGE_NAMES:-}+ FLUXER_PLAY_INTEGRITY_CERT_SHA256: ${FLUXER_PLAY_INTEGRITY_CERT_SHA256:-}+ FLUXER_PLAY_INTEGRITY_SERVICE_ACCOUNT_JSON_PATH: ${FLUXER_PLAY_INTEGRITY_SERVICE_ACCOUNT_JSON_PATH:-}+ FLUXER_PLAY_INTEGRITY_DEVICE_INTEGRITY: ${FLUXER_PLAY_INTEGRITY_DEVICE_INTEGRITY:-}FLUXER_SUDO_MODE_SECRET: ${FLUXER_SUDO_MODE_SECRET:-}FLUXER_CONNECTION_INITIATION_SECRET: ${FLUXER_CONNECTION_INITIATION_SECRET:-}diff --git a/fluxer_users/Cargo.toml b/fluxer_users/Cargo.tomlindex 26a8fc96a..aeb186667 100644--- a/fluxer_users/Cargo.toml+++ b/fluxer_users/Cargo.toml@@ -15,12 +15,13 @@ fluxer-svc = { path = "../fluxer_svc" }futures = "0.3.34"hmac = "0.13.0"moka = { version = "0.12.16", features = ["future"] }+reqwest = { version = "0.13.5", default-features = false, features = ["json", "rustls"] }ring = "0.17.14"scylla = { version = "1.9.0", features = ["chrono-04"], optional = true }serde = { version = "1.0.229", features = ["derive"] }serde_json = "1.0.154"sha2 = "0.11.1"-tokio = { version = "1.54.1", features = ["macros", "rt-multi-thread", "signal", "sync"] }+tokio = { version = "1.54.1", features = ["macros", "rt-multi-thread", "signal", "sync", "time"] }tracing = "0.1.44"x509-cert = { version = "0.2.5", default-features = false, features = ["std"] }diff --git a/fluxer_users/src/app_attest/mod.rs b/fluxer_users/src/app_attest/mod.rsindex d4ff4f8bd..44e0a74a8 100644--- a/fluxer_users/src/app_attest/mod.rs+++ b/fluxer_users/src/app_attest/mod.rs@@ -103,6 +103,7 @@ impl Environment {pub enum ChallengePurpose {Attest,Assert,+ PlayIntegrity,}impl ChallengePurpose {@@ -110,6 +111,16 @@ impl ChallengePurpose {match self {ChallengePurpose::Attest => "attest",ChallengePurpose::Assert => "assert",+ ChallengePurpose::PlayIntegrity => "play_integrity",+ }+ }++ pub fn parse(value: &str) -> Option<Self> {+ match value {+ "attest" => Some(ChallengePurpose::Attest),+ "assert" => Some(ChallengePurpose::Assert),+ "play_integrity" => Some(ChallengePurpose::PlayIntegrity),+ _ => None,}}}diff --git a/fluxer_users/src/app_attest/service.rs b/fluxer_users/src/app_attest/service.rsindex 80dca3271..1e9861fa8 100644--- a/fluxer_users/src/app_attest/service.rs+++ b/fluxer_users/src/app_attest/service.rs@@ -16,7 +16,7 @@ const CHALLENGE_BYTES: usize = 32;const CHALLENGE_TEXT_LEN: usize = 43;const MAX_ATTESTATION_BYTES: usize = 16 * 1024;const MAX_ASSERTION_BYTES: usize = 4 * 1024;-const MAX_CLIENT_DATA_BYTES: usize = 1024;+pub const MAX_CLIENT_DATA_BYTES: usize = 1024;const STANDARD_ANY_PADDING: GeneralPurpose = GeneralPurpose::new(&base64::alphabet::STANDARD,@@ -56,26 +56,7 @@ impl AppAttestService {if !self.config.is_enabled() {return Ok(rejected(AppAttestRejection::NotConfigured));}- let mut bytes = [0u8; CHALLENGE_BYTES];- self.random- .fill(&mut bytes)- .map_err(|_| anyhow::anyhow!("system random source failed"))?;- let challenge = URL_SAFE_NO_PAD.encode(bytes);- let expires_at_ms = unix_ms(now) + CHALLENGE_TTL_SECONDS * 1000;- self.store- .insert_challenge(- &challenge,- &ChallengeRecord {- user_id,- purpose,- expires_at_ms,- },- )- .await?;- Ok(UserResponse::AppAttestChallenge {- challenge,- expires_at: iso_millis(expires_at_ms),- })+ issue_challenge(&self.store, &self.random, user_id, purpose, now).await}pub async fn register_key(@@ -109,9 +90,14 @@ impl AppAttestService {let Some(attestation) = decode_limited(attestation_base64, MAX_ATTESTATION_BYTES) else {return Ok(Err(AppAttestRejection::InvalidRequest));};- if !self- .consume_challenge(challenge, user_id, ChallengePurpose::Attest, now)- .await?+ if !consume_challenge(+ &self.store,+ challenge,+ user_id,+ ChallengePurpose::Attest,+ now,+ )+ .await?{return Ok(Err(AppAttestRejection::InvalidChallenge));}@@ -193,9 +179,14 @@ impl AppAttestService {let Ok(parsed) = serde_json::from_slice::<AgeClientData>(&client_data) else {return Ok(Err(AppAttestRejection::InvalidRequest));};- if !self- .consume_challenge(&parsed.challenge, user_id, ChallengePurpose::Assert, now)- .await?+ if !consume_challenge(+ &self.store,+ &parsed.challenge,+ user_id,+ ChallengePurpose::Assert,+ now,+ )+ .await?{return Ok(Err(AppAttestRejection::InvalidChallenge));}@@ -236,21 +227,50 @@ impl AppAttestService {attested_at: iso_millis(now_ms),}))}+}- async fn consume_challenge(- &self,- challenge: &str,- user_id: i64,- purpose: ChallengePurpose,- now: SystemTime,- ) -> anyhow::Result<bool> {- if challenge.len() != CHALLENGE_TEXT_LEN || URL_SAFE_NO_PAD.decode(challenge).is_err() {- return Ok(false);- }- self.store- .consume_challenge(challenge, user_id, purpose, unix_ms(now))- .await+pub async fn issue_challenge(+ store: &AppAttestStore,+ random: &SystemRandom,+ user_id: i64,+ purpose: ChallengePurpose,+ now: SystemTime,+) -> anyhow::Result<UserResponse> {+ let mut bytes = [0u8; CHALLENGE_BYTES];+ random+ .fill(&mut bytes)+ .map_err(|_| anyhow::anyhow!("system random source failed"))?;+ let challenge = URL_SAFE_NO_PAD.encode(bytes);+ let expires_at_ms = unix_ms(now) + CHALLENGE_TTL_SECONDS * 1000;+ store+ .insert_challenge(+ &challenge,+ &ChallengeRecord {+ user_id,+ purpose,+ expires_at_ms,+ },+ )+ .await?;+ Ok(UserResponse::AppAttestChallenge {+ challenge,+ expires_at: iso_millis(expires_at_ms),+ })+}++pub async fn consume_challenge(+ store: &AppAttestStore,+ challenge: &str,+ user_id: i64,+ purpose: ChallengePurpose,+ now: SystemTime,+) -> anyhow::Result<bool> {+ if challenge.len() != CHALLENGE_TEXT_LEN || URL_SAFE_NO_PAD.decode(challenge).is_err() {+ return Ok(false);}+ store+ .consume_challenge(challenge, user_id, purpose, unix_ms(now))+ .await}fn keys_to_evict(keys: &[StoredKey], max_keys: usize) -> Vec<String> {@@ -274,7 +294,7 @@ fn decode_key_id(key_id: &str) -> Option<[u8; KEY_ID_LEN]> {STANDARD_ANY_PADDING.decode(key_id).ok()?.try_into().ok()}-fn decode_limited(value: &str, max_bytes: usize) -> Option<Vec<u8>> {+pub fn decode_limited(value: &str, max_bytes: usize) -> Option<Vec<u8>> {if value.len() > max_bytes.div_ceil(3) * 4 {return None;}@@ -292,7 +312,7 @@ fn rejected(code: AppAttestRejection) -> UserResponse {UserResponse::AppAttestRejected { code }}-fn unix_ms(now: SystemTime) -> i64 {+pub fn unix_ms(now: SystemTime) -> i64 {now.duration_since(UNIX_EPOCH).map(|elapsed| elapsed.as_millis() as i64).unwrap_or_default()diff --git a/fluxer_users/src/app_attest/store.rs b/fluxer_users/src/app_attest/store.rsindex 656d04575..710905c53 100644--- a/fluxer_users/src/app_attest/store.rs+++ b/fluxer_users/src/app_attest/store.rs@@ -249,11 +249,7 @@ pub fn iso_millis(ms: i64) -> String {fn decode_challenge(row: Value) -> Option<ChallengeRecord> {let row = postgres::decode_row_dates_as_millis(row).ok()?;- let purpose = match row.get("purpose")?.as_str()? {- "attest" => ChallengePurpose::Attest,- "assert" => ChallengePurpose::Assert,- _ => return None,- };+ let purpose = ChallengePurpose::parse(row.get("purpose")?.as_str()?)?;Some(ChallengeRecord {user_id: row.get("user_id")?.as_i64()?,purpose,diff --git a/fluxer_users/src/app_attest/verifier.rs b/fluxer_users/src/app_attest/verifier.rsindex f5c103c39..a20e3f940 100644--- a/fluxer_users/src/app_attest/verifier.rs+++ b/fluxer_users/src/app_attest/verifier.rs@@ -469,7 +469,7 @@ fn sha256_concat(first: &[u8], second: &[u8]) -> [u8; 32] {hasher.finalize().into()}-fn constant_time_eq(left: &[u8], right: &[u8]) -> bool {+pub fn constant_time_eq(left: &[u8], right: &[u8]) -> bool {left.len() == right.len()&& left.iter()diff --git a/fluxer_users/src/main.rs b/fluxer_users/src/main.rsindex 0b0303b11..f01946644 100644--- a/fluxer_users/src/main.rs+++ b/fluxer_users/src/main.rs@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-or-latermod app_attest;+mod play_integrity;mod pseudonym;mod router_impl;mod shard_impl;@@ -48,25 +49,39 @@ async fn build_shard(config: &ServiceConfig) -> anyhow::Result<UsersShard> {allow_development = app_attest.allow_development,"app attest configuration");+ let play_integrity = play_integrity::PlayIntegrityConfig::from_env()?;+ tracing::info!(+ package_names = play_integrity.package_names.len(),+ cert_digests = play_integrity.cert_digests.len(),+ device_integrity = ?play_integrity.device_integrity,+ "play integrity configuration"+ );match config.database_backend {DatabaseBackend::Postgres => {let postgres_config = fluxer_svc::postgres::PostgresConfig::from_service_config(config);let pool = fluxer_svc::postgres::connect(&postgres_config).await?;let kv = fluxer_svc::postgres::KvClient::new(pool, &postgres_config)?;- Ok(UsersShard::new_postgres(+ UsersShard::new_postgres(kv,config.cache_max_entries,config.cache_ttl,app_attest,- ))+ play_integrity,+ )}DatabaseBackend::Cassandra => {#[cfg(feature = "scylla")]{let scylla_config = fluxer_svc::scylla::ScyllaConfig::from_service_config(config);let db = fluxer_svc::scylla::connect(&scylla_config).await?;- UsersShard::new_scylla(db, config.cache_max_entries, config.cache_ttl, app_attest)- .await+ UsersShard::new_scylla(+ db,+ config.cache_max_entries,+ config.cache_ttl,+ app_attest,+ play_integrity,+ )+ .await}#[cfg(not(feature = "scylla"))]{diff --git a/fluxer_users/src/play_integrity/google.rs b/fluxer_users/src/play_integrity/google.rsnew file mode 100644index 000000000..ca8fed98c--- /dev/null+++ b/fluxer_users/src/play_integrity/google.rs@@ -0,0 +1,225 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++use super::ServiceAccount;+use base64::Engine;+use base64::engine::general_purpose::{STANDARD, URL_SAFE_NO_PAD};+use ring::rand::SystemRandom;+use ring::signature::{RSA_PKCS1_SHA256, RsaKeyPair};+use serde_json::{Value, json};+use std::sync::Mutex;+use std::time::Duration;+use tokio::sync::Semaphore;++const SCOPE: &str = "https://www.googleapis.com/auth/playintegrity";+const GRANT_TYPE: &str = "urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer";+const DECODE_BASE_URL: &str = "https://playintegrity.googleapis.com/v1";+const ASSERTION_TTL_SECONDS: i64 = 3_600;+const TOKEN_SKEW_SECONDS: i64 = 60;+const DEFAULT_EXPIRES_IN_SECONDS: i64 = 3_600;+const EXCHANGE_TIMEOUT: Duration = Duration::from_secs(4);+const REQUEST_TIMEOUT: Duration = Duration::from_secs(3);+const CONNECT_TIMEOUT: Duration = Duration::from_secs(2);+const MAX_CONCURRENT_EXCHANGES: usize = 8;++#[derive(Debug)]+pub enum DecodeError {+ TokenRejected,+ Refused(u16),+ Unavailable(String),+}++struct CachedToken {+ token: String,+ expires_at: i64,+}++pub struct GoogleClient {+ http: reqwest::Client,+ account: ServiceAccount,+ key: RsaKeyPair,+ random: SystemRandom,+ token: Mutex<Option<CachedToken>>,+ exchanges: Semaphore,+}++impl GoogleClient {+ pub fn new(account: ServiceAccount) -> anyhow::Result<Self> {+ let key = parse_rsa_pkcs8_pem(&account.private_key)+ .ok_or_else(|| anyhow::anyhow!("play integrity service account key is not RSA"))?;+ let http = reqwest::Client::builder()+ .timeout(REQUEST_TIMEOUT)+ .connect_timeout(CONNECT_TIMEOUT)+ .build()?;+ Ok(Self {+ http,+ account,+ key,+ random: SystemRandom::new(),+ token: Mutex::new(None),+ exchanges: Semaphore::new(MAX_CONCURRENT_EXCHANGES),+ })+ }++ pub async fn decode_integrity_token(+ &self,+ package_name: &str,+ integrity_token: &str,+ now_seconds: i64,+ ) -> Result<Value, DecodeError> {+ let _permit = self.exchanges.try_acquire().map_err(|_| {+ DecodeError::Unavailable("too many google exchanges in flight".to_owned())+ })?;+ tokio::time::timeout(+ EXCHANGE_TIMEOUT,+ self.exchange(package_name, integrity_token, now_seconds),+ )+ .await+ .map_err(|_| DecodeError::Unavailable("google exchange timed out".to_owned()))?+ }++ async fn exchange(+ &self,+ package_name: &str,+ integrity_token: &str,+ now_seconds: i64,+ ) -> Result<Value, DecodeError> {+ let access_token = self.access_token(now_seconds).await?;+ let response = self+ .http+ .post(format!(+ "{DECODE_BASE_URL}/{package_name}:decodeIntegrityToken"+ ))+ .bearer_auth(access_token)+ .json(&json!({"integrityToken": integrity_token}))+ .send()+ .await+ .map_err(|error| DecodeError::Unavailable(format!("decode request failed: {error}")))?;+ let status = response.status();+ match status {+ reqwest::StatusCode::BAD_REQUEST => return Err(DecodeError::TokenRejected),+ reqwest::StatusCode::FORBIDDEN | reqwest::StatusCode::NOT_FOUND => {+ return Err(DecodeError::Refused(status.as_u16()));+ }+ reqwest::StatusCode::UNAUTHORIZED => self.clear_cached_token(),+ _ => {}+ }+ if !status.is_success() {+ return Err(DecodeError::Unavailable(format!(+ "decode returned status {}",+ status.as_u16()+ )));+ }+ let mut body: Value = response.json().await.map_err(|error| {+ DecodeError::Unavailable(format!("decode response unreadable: {error}"))+ })?;+ match body.get_mut("tokenPayloadExternal").map(Value::take) {+ Some(payload @ Value::Object(_)) => Ok(payload),+ _ => Err(DecodeError::Unavailable(+ "decode response has no tokenPayloadExternal".to_owned(),+ )),+ }+ }++ fn cached_token(&self, now_seconds: i64) -> Option<String> {+ let cache = self.token.lock().ok()?;+ cache+ .as_ref()+ .filter(|cached| cached.expires_at - TOKEN_SKEW_SECONDS > now_seconds)+ .map(|cached| cached.token.clone())+ }++ fn clear_cached_token(&self) {+ if let Ok(mut cache) = self.token.lock() {+ *cache = None;+ }+ }++ async fn access_token(&self, now_seconds: i64) -> Result<String, DecodeError> {+ if let Some(token) = self.cached_token(now_seconds) {+ return Ok(token);+ }+ let assertion = self+ .assertion(now_seconds)+ .ok_or_else(|| DecodeError::Unavailable("signing the assertion failed".to_owned()))?;+ let response = self+ .http+ .post(&self.account.token_uri)+ .header(+ reqwest::header::CONTENT_TYPE,+ "application/x-www-form-urlencoded",+ )+ .body(format!("grant_type={GRANT_TYPE}&assertion={assertion}"))+ .send()+ .await+ .map_err(|error| DecodeError::Unavailable(format!("token request failed: {error}")))?;+ let status = response.status();+ if !status.is_success() {+ return Err(DecodeError::Unavailable(format!(+ "token endpoint returned status {}",+ status.as_u16()+ )));+ }+ let body: Value = response.json().await.map_err(|error| {+ DecodeError::Unavailable(format!("token response unreadable: {error}"))+ })?;+ let token = body+ .get("access_token")+ .and_then(Value::as_str)+ .filter(|token| !token.is_empty())+ .ok_or_else(|| {+ DecodeError::Unavailable("token response has no access_token".to_owned())+ })?+ .to_owned();+ let expires_in = body+ .get("expires_in")+ .and_then(Value::as_i64)+ .filter(|seconds| *seconds > 0)+ .unwrap_or(DEFAULT_EXPIRES_IN_SECONDS);+ if let Ok(mut cache) = self.token.lock() {+ *cache = Some(CachedToken {+ token: token.clone(),+ expires_at: now_seconds + expires_in,+ });+ }+ Ok(token)+ }++ fn assertion(&self, now_seconds: i64) -> Option<String> {+ let header = json!({"alg": "RS256", "typ": "JWT"});+ let claims = json!({+ "iss": self.account.client_email,+ "scope": SCOPE,+ "aud": self.account.token_uri,+ "iat": now_seconds,+ "exp": now_seconds + ASSERTION_TTL_SECONDS,+ });+ let signing_input = format!(+ "{}.{}",+ URL_SAFE_NO_PAD.encode(serde_json::to_vec(&header).ok()?),+ URL_SAFE_NO_PAD.encode(serde_json::to_vec(&claims).ok()?)+ );+ let mut signature = vec![0u8; self.key.public().modulus_len()];+ self.key+ .sign(+ &RSA_PKCS1_SHA256,+ &self.random,+ signing_input.as_bytes(),+ &mut signature,+ )+ .ok()?;+ Some(format!(+ "{signing_input}.{}",+ URL_SAFE_NO_PAD.encode(signature)+ ))+ }+}++pub fn parse_rsa_pkcs8_pem(pem: &str) -> Option<RsaKeyPair> {+ let body: String = pem+ .replace("\\n", "\n")+ .lines()+ .filter(|line| !line.trim().starts_with("-----"))+ .flat_map(|line| line.chars().filter(|c| !c.is_ascii_whitespace()))+ .collect();+ RsaKeyPair::from_pkcs8(&STANDARD.decode(body).ok()?).ok()+}diff --git a/fluxer_users/src/play_integrity/mod.rs b/fluxer_users/src/play_integrity/mod.rsnew file mode 100644index 000000000..5e3fdb814--- /dev/null+++ b/fluxer_users/src/play_integrity/mod.rs@@ -0,0 +1,216 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++pub mod google;+pub mod service;+pub mod verifier;++use anyhow::Context;+use base64::Engine;+use base64::engine::general_purpose::{GeneralPurpose, GeneralPurposeConfig};+use base64::engine::{DecodePaddingMode, general_purpose};+use fluxer_svc::config::optional_env;+use serde::{Deserialize, Serialize};++const PACKAGE_NAMES_ENV: &str = "FLUXER_PLAY_INTEGRITY_PACKAGE_NAMES";+const CERT_SHA256_ENV: &str = "FLUXER_PLAY_INTEGRITY_CERT_SHA256";+const SERVICE_ACCOUNT_ENV: &str = "FLUXER_PLAY_INTEGRITY_SERVICE_ACCOUNT_JSON_PATH";+const DEVICE_INTEGRITY_ENV: &str = "FLUXER_PLAY_INTEGRITY_DEVICE_INTEGRITY";+const DEFAULT_TOKEN_URI: &str = "https://oauth2.googleapis.com/token";+const MAX_PACKAGE_NAME_LEN: usize = 255;+const SHA256_LEN: usize = 32;++pub const URL_SAFE_ANY_PADDING: GeneralPurpose = GeneralPurpose::new(+ &base64::alphabet::URL_SAFE,+ GeneralPurposeConfig::new().with_decode_padding_mode(DecodePaddingMode::Indifferent),+);++#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]+pub enum DeviceIntegrity {+ #[default]+ Device,+ Strong,+}++#[derive(Clone, Default, PartialEq, Eq)]+pub struct ServiceAccount {+ pub client_email: String,+ pub private_key: String,+ pub token_uri: String,+}++impl std::fmt::Debug for ServiceAccount {+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {+ f.debug_struct("ServiceAccount")+ .field("client_email", &self.client_email)+ .field("token_uri", &self.token_uri)+ .finish_non_exhaustive()+ }+}++#[derive(Clone, Debug, Default, PartialEq, Eq)]+pub struct PlayIntegrityConfig {+ pub package_names: Vec<String>,+ pub cert_digests: Vec<[u8; SHA256_LEN]>,+ pub device_integrity: DeviceIntegrity,+ pub service_account: Option<ServiceAccount>,+}++#[derive(Deserialize)]+struct ServiceAccountFile {+ client_email: Option<String>,+ private_key: Option<String>,+ token_uri: Option<String>,+}++impl PlayIntegrityConfig {+ pub fn from_env() -> anyhow::Result<Self> {+ let service_account = optional_env(SERVICE_ACCOUNT_ENV)+ .filter(|path| !path.trim().is_empty())+ .map(|path| {+ std::fs::read_to_string(path.trim())+ .with_context(|| format!("{SERVICE_ACCOUNT_ENV} could not be read: {path}"))+ })+ .transpose()?;+ Self::parse(+ optional_env(PACKAGE_NAMES_ENV).as_deref(),+ optional_env(CERT_SHA256_ENV).as_deref(),+ optional_env(DEVICE_INTEGRITY_ENV).as_deref(),+ service_account.as_deref(),+ )+ }++ pub fn parse(+ package_names: Option<&str>,+ cert_digests: Option<&str>,+ device_integrity: Option<&str>,+ service_account_json: Option<&str>,+ ) -> anyhow::Result<Self> {+ let package_names = split_list(package_names)+ .map(|name| {+ if is_valid_package_name(name) {+ Ok(name.to_owned())+ } else {+ Err(anyhow::anyhow!(+ "{PACKAGE_NAMES_ENV} entry {name:?} is not an Android package name"+ ))+ }+ })+ .collect::<anyhow::Result<Vec<_>>>()?;+ let cert_digests = split_list(cert_digests)+ .map(|digest| {+ parse_cert_digest(digest).ok_or_else(|| {+ anyhow::anyhow!(+ "{CERT_SHA256_ENV} entry {digest:?} is not a SHA-256 digest in base64url or hex"+ )+ })+ })+ .collect::<anyhow::Result<Vec<_>>>()?;+ let device_integrity = match device_integrity+ .map(|value| value.trim().to_ascii_lowercase())+ .as_deref()+ {+ None | Some("" | "device") => DeviceIntegrity::Device,+ Some("strong") => DeviceIntegrity::Strong,+ Some(other) => anyhow::bail!("{DEVICE_INTEGRITY_ENV} has an invalid value {other:?}"),+ };+ if package_names.is_empty() {+ return Ok(Self {+ device_integrity,+ ..Self::default()+ });+ }+ if cert_digests.is_empty() {+ anyhow::bail!("{CERT_SHA256_ENV} is required when {PACKAGE_NAMES_ENV} is set");+ }+ let service_account = parse_service_account(service_account_json.ok_or_else(|| {+ anyhow::anyhow!("{SERVICE_ACCOUNT_ENV} is required when {PACKAGE_NAMES_ENV} is set")+ })?)?;+ Ok(Self {+ package_names,+ cert_digests,+ device_integrity,+ service_account: Some(service_account),+ })+ }++ pub fn is_enabled(&self) -> bool {+ !self.package_names.is_empty() && self.service_account.is_some()+ }++ pub fn allows_package(&self, package_name: &str) -> bool {+ self.package_names.iter().any(|name| name == package_name)+ }+}++fn split_list(value: Option<&str>) -> impl Iterator<Item = &str> {+ value+ .unwrap_or_default()+ .split(',')+ .map(str::trim)+ .filter(|entry| !entry.is_empty())+}++fn parse_service_account(json: &str) -> anyhow::Result<ServiceAccount> {+ let file: ServiceAccountFile = serde_json::from_str(json)+ .map_err(|_| anyhow::anyhow!("{SERVICE_ACCOUNT_ENV} is not a service account JSON file"))?;+ let client_email = file+ .client_email+ .filter(|email| !email.is_empty())+ .ok_or_else(|| anyhow::anyhow!("{SERVICE_ACCOUNT_ENV} has no client_email"))?;+ let private_key = file+ .private_key+ .filter(|key| !key.is_empty())+ .ok_or_else(|| anyhow::anyhow!("{SERVICE_ACCOUNT_ENV} has no private_key"))?;+ google::parse_rsa_pkcs8_pem(&private_key)+ .ok_or_else(|| anyhow::anyhow!("{SERVICE_ACCOUNT_ENV} private_key is not an RSA key"))?;+ let token_uri = file+ .token_uri+ .filter(|uri| uri.starts_with("https://"))+ .unwrap_or_else(|| DEFAULT_TOKEN_URI.to_owned());+ Ok(ServiceAccount {+ client_email,+ private_key,+ token_uri,+ })+}++pub fn is_valid_package_name(name: &str) -> bool {+ name.len() <= MAX_PACKAGE_NAME_LEN+ && name.split('.').count() >= 2+ && name.split('.').all(|segment| {+ let mut bytes = segment.bytes();+ bytes+ .next()+ .is_some_and(|first| first.is_ascii_alphabetic())+ && bytes.all(|byte| byte.is_ascii_alphanumeric() || byte == b'_')+ })+}++pub fn parse_cert_digest(value: &str) -> Option<[u8; SHA256_LEN]> {+ let hex = value.replace(':', "");+ if hex.len() == SHA256_LEN * 2 && hex.bytes().all(|byte| byte.is_ascii_hexdigit()) {+ let mut digest = [0u8; SHA256_LEN];+ for (index, byte) in digest.iter_mut().enumerate() {+ *byte = u8::from_str_radix(&hex[index * 2..index * 2 + 2], 16).ok()?;+ }+ return Some(digest);+ }+ URL_SAFE_ANY_PADDING+ .decode(value)+ .or_else(|_| general_purpose::STANDARD.decode(value))+ .ok()?+ .try_into()+ .ok()+}++#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "snake_case")]+pub enum PlayIntegrityRejection {+ NotConfigured,+ InvalidRequest,+ InvalidChallenge,+ InvalidToken,+ AppNotRecognized,+ DeviceNotTrusted,+ Unavailable,+}diff --git a/fluxer_users/src/play_integrity/service.rs b/fluxer_users/src/play_integrity/service.rsnew file mode 100644index 000000000..c86593b89--- /dev/null+++ b/fluxer_users/src/play_integrity/service.rs@@ -0,0 +1,163 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++use super::google::{DecodeError, GoogleClient};+use super::verifier::{self, AgeSignalsClientData};+use super::{PlayIntegrityConfig, PlayIntegrityRejection};+use crate::app_attest::ChallengePurpose;+use crate::app_attest::service::{+ MAX_CLIENT_DATA_BYTES, consume_challenge, decode_limited, issue_challenge, unix_ms,+};+use crate::app_attest::store::{AppAttestStore, iso_millis};+use crate::types::UserResponse;+use ring::rand::SystemRandom;+use std::time::SystemTime;++const MAX_INTEGRITY_TOKEN_LEN: usize = 16 * 1024;++pub struct PlayIntegrityService {+ config: PlayIntegrityConfig,+ google: Option<GoogleClient>,+ store: AppAttestStore,+ random: SystemRandom,+}++type Outcome = Result<UserResponse, PlayIntegrityRejection>;++impl PlayIntegrityService {+ pub fn new(config: PlayIntegrityConfig, store: AppAttestStore) -> anyhow::Result<Self> {+ let google = match (&config.service_account, config.is_enabled()) {+ (Some(account), true) => Some(GoogleClient::new(account.clone())?),+ _ => None,+ };+ Ok(Self {+ config,+ google,+ store,+ random: SystemRandom::new(),+ })+ }++ pub async fn create_challenge(+ &self,+ user_id: i64,+ now: SystemTime,+ ) -> anyhow::Result<UserResponse> {+ if self.google.is_none() {+ return Ok(rejected(PlayIntegrityRejection::NotConfigured));+ }+ issue_challenge(+ &self.store,+ &self.random,+ user_id,+ ChallengePurpose::PlayIntegrity,+ now,+ )+ .await+ }++ pub async fn submit_age(+ &self,+ user_id: i64,+ package_name: &str,+ integrity_token: &str,+ client_data_base64: &str,+ now: SystemTime,+ ) -> anyhow::Result<UserResponse> {+ Ok(self+ .try_submit_age(+ user_id,+ package_name,+ integrity_token,+ client_data_base64,+ now,+ )+ .await?+ .unwrap_or_else(rejected))+ }++ async fn try_submit_age(+ &self,+ user_id: i64,+ package_name: &str,+ integrity_token: &str,+ client_data_base64: &str,+ now: SystemTime,+ ) -> anyhow::Result<Outcome> {+ let Some(google) = &self.google else {+ return Ok(Err(PlayIntegrityRejection::NotConfigured));+ };+ if !self.config.allows_package(package_name) || !is_plausible_token(integrity_token) {+ return Ok(Err(PlayIntegrityRejection::InvalidRequest));+ }+ let Some(client_data) = decode_limited(client_data_base64, MAX_CLIENT_DATA_BYTES) else {+ return Ok(Err(PlayIntegrityRejection::InvalidRequest));+ };+ let Ok(parsed) = serde_json::from_slice::<AgeSignalsClientData>(&client_data) else {+ return Ok(Err(PlayIntegrityRejection::InvalidRequest));+ };+ let Some(age_floor) = parsed.age_floor() else {+ return Ok(Err(PlayIntegrityRejection::InvalidRequest));+ };+ if !consume_challenge(+ &self.store,+ &parsed.challenge,+ user_id,+ ChallengePurpose::PlayIntegrity,+ now,+ )+ .await?+ {+ return Ok(Err(PlayIntegrityRejection::InvalidChallenge));+ }+ let now_ms = unix_ms(now);+ let payload = match google+ .decode_integrity_token(package_name, integrity_token, now_ms / 1000)+ .await+ {+ Ok(payload) => payload,+ Err(DecodeError::TokenRejected) => {+ tracing::info!(user_id, "play integrity token rejected by google");+ return Ok(Err(PlayIntegrityRejection::InvalidToken));+ }+ Err(DecodeError::Refused(status)) => {+ tracing::error!(+ user_id,+ status,+ "play integrity decode refused, check the cloud project link"+ );+ return Ok(Err(PlayIntegrityRejection::InvalidToken));+ }+ Err(DecodeError::Unavailable(reason)) => {+ tracing::warn!(user_id, reason, "play integrity decode unavailable");+ return Ok(Err(PlayIntegrityRejection::Unavailable));+ }+ };+ if let Err(rejection) = verifier::verify_payload(+ payload,+ package_name,+ &verifier::request_hash(&client_data),+ &self.config,+ now_ms,+ ) {+ tracing::info!(user_id, ?rejection, "play integrity verdict rejected");+ return Ok(Err(rejection));+ }+ tracing::info!(user_id, "play integrity age verified");+ Ok(Ok(UserResponse::AppAttestAgeAccepted {+ age_floor,+ attested_at: iso_millis(now_ms),+ }))+ }+}++fn is_plausible_token(token: &str) -> bool {+ !token.is_empty()+ && token.len() <= MAX_INTEGRITY_TOKEN_LEN+ && token+ .bytes()+ .all(|byte| byte.is_ascii_graphic() && byte != b'"' && byte != b'\\')+}++fn rejected(code: PlayIntegrityRejection) -> UserResponse {+ UserResponse::PlayIntegrityRejected { code }+}diff --git a/fluxer_users/src/play_integrity/verifier.rs b/fluxer_users/src/play_integrity/verifier.rsnew file mode 100644index 000000000..0a7314d25--- /dev/null+++ b/fluxer_users/src/play_integrity/verifier.rs@@ -0,0 +1,286 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++use super::{DeviceIntegrity, PlayIntegrityConfig, PlayIntegrityRejection, URL_SAFE_ANY_PADDING};+use crate::app_attest::AgeFloor;+use crate::app_attest::verifier::{constant_time_eq, sha256};+use base64::Engine;+use base64::engine::general_purpose::URL_SAFE_NO_PAD;+use serde::Deserialize;+use serde_json::Value;++const PLAY_RECOGNIZED: &str = "PLAY_RECOGNIZED";+const LICENSED: &str = "LICENSED";+const MEETS_DEVICE_INTEGRITY: &str = "MEETS_DEVICE_INTEGRITY";+const MEETS_STRONG_INTEGRITY: &str = "MEETS_STRONG_INTEGRITY";+const MAX_TOKEN_AGE_MS: i64 = 5 * 60 * 1000;+const MAX_CLOCK_SKEW_MS: i64 = 60 * 1000;+const ADULT_AGE: u8 = 18;+const MINIMUM_AGE: u8 = 13;+const MIN_AGE_UPPER: u8 = 2;++#[derive(Debug, Deserialize)]+#[serde(rename_all = "camelCase")]+struct TokenPayload {+ request_details: RequestDetails,+ app_integrity: AppIntegrity,+ device_integrity: DeviceIntegrityVerdict,+ account_details: AccountDetails,+ #[serde(default)]+ testing_details: Option<TestingDetails>,+}++#[derive(Debug, Deserialize)]+#[serde(rename_all = "camelCase")]+struct RequestDetails {+ request_package_name: String,+ #[serde(default)]+ request_hash: Option<String>,+ timestamp_millis: String,+}++#[derive(Debug, Deserialize)]+#[serde(rename_all = "camelCase")]+struct AppIntegrity {+ app_recognition_verdict: String,+ #[serde(default)]+ package_name: Option<String>,+ #[serde(default)]+ certificate_sha256_digest: Vec<String>,+}++#[derive(Debug, Deserialize)]+#[serde(rename_all = "camelCase")]+struct DeviceIntegrityVerdict {+ #[serde(default)]+ device_recognition_verdict: Vec<String>,+}++#[derive(Debug, Deserialize)]+#[serde(rename_all = "camelCase")]+struct AccountDetails {+ app_licensing_verdict: String,+}++#[derive(Debug, Deserialize)]+#[serde(rename_all = "camelCase")]+struct TestingDetails {+ #[serde(default)]+ is_testing_response: bool,+}++#[derive(Debug, Deserialize)]+#[serde(deny_unknown_fields)]+pub struct AgeSignalsClientData {+ pub challenge: String,+ pub age_lower: u8,+ pub age_upper: Option<u8>,+ #[serde(rename = "age_range_source")]+ _age_range_source: AgeRangeSource,+}++#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize)]+#[serde(rename_all = "snake_case")]+pub enum AgeRangeSource {+ TierA,+ TierB,+ TierC,+ TierD,+}++impl AgeSignalsClientData {+ pub fn age_floor(&self) -> Option<AgeFloor> {+ if self.age_lower > ADULT_AGE {+ return None;+ }+ if let Some(upper) = self.age_upper+ && (!(MIN_AGE_UPPER..=ADULT_AGE).contains(&upper)+ || upper < self.age_lower+ || (self.age_lower == ADULT_AGE && upper != ADULT_AGE))+ {+ return None;+ }+ Some(if self.age_lower >= ADULT_AGE {+ AgeFloor::Adult+ } else if self.age_lower >= MINIMUM_AGE {+ AgeFloor::Minor+ } else {+ AgeFloor::UnderMinimum+ })+ }+}++pub fn request_hash(client_data: &[u8]) -> String {+ URL_SAFE_NO_PAD.encode(sha256(client_data))+}++pub fn verify_payload(+ payload: Value,+ package_name: &str,+ expected_request_hash: &str,+ config: &PlayIntegrityConfig,+ now_ms: i64,+) -> Result<(), PlayIntegrityRejection> {+ let payload: TokenPayload =+ serde_json::from_value(payload).map_err(|_| PlayIntegrityRejection::InvalidToken)?;+ if payload+ .testing_details+ .is_some_and(|details| details.is_testing_response)+ {+ return Err(PlayIntegrityRejection::InvalidToken);+ }+ let request = &payload.request_details;+ let request_hash = request.request_hash.as_deref().unwrap_or_default();+ if request.request_package_name != package_name+ || !constant_time_eq(request_hash.as_bytes(), expected_request_hash.as_bytes())+ {+ return Err(PlayIntegrityRejection::InvalidToken);+ }+ let timestamp_ms = request+ .timestamp_millis+ .parse::<i64>()+ .map_err(|_| PlayIntegrityRejection::InvalidToken)?;+ if now_ms.saturating_sub(timestamp_ms) > MAX_TOKEN_AGE_MS+ || timestamp_ms.saturating_sub(now_ms) > MAX_CLOCK_SKEW_MS+ {+ return Err(PlayIntegrityRejection::InvalidToken);+ }+ let app = &payload.app_integrity;+ if app.app_recognition_verdict != PLAY_RECOGNIZED+ || app.package_name.as_deref() != Some(package_name)+ || !app+ .certificate_sha256_digest+ .iter()+ .filter_map(|digest| URL_SAFE_ANY_PADDING.decode(digest).ok())+ .any(|digest| {+ config+ .cert_digests+ .iter()+ .any(|allowed| constant_time_eq(allowed, &digest))+ })+ || payload.account_details.app_licensing_verdict != LICENSED+ {+ return Err(PlayIntegrityRejection::AppNotRecognized);+ }+ let labels = &payload.device_integrity.device_recognition_verdict;+ let has = |label: &str| labels.iter().any(|candidate| candidate == label);+ let trusted = match config.device_integrity {+ DeviceIntegrity::Device => has(MEETS_DEVICE_INTEGRITY) || has(MEETS_STRONG_INTEGRITY),+ DeviceIntegrity::Strong => has(MEETS_STRONG_INTEGRITY),+ };+ if !trusted {+ return Err(PlayIntegrityRejection::DeviceNotTrusted);+ }+ Ok(())+}++#[cfg(test)]+mod tests {+ use super::*;+ use serde_json::json;++ const PACKAGE: &str = "com.fluxer";+ const NOW_MS: i64 = 1_800_000_000_000;+ const CLIENT_DATA: &[u8] =+ br#"{"challenge":"c","age_lower":18,"age_upper":null,"age_range_source":"tier_c"}"#;++ fn cert() -> [u8; 32] {+ sha256(b"fluxer signing certificate")+ }++ fn config() -> PlayIntegrityConfig {+ PlayIntegrityConfig {+ package_names: vec![PACKAGE.to_owned()],+ cert_digests: vec![cert()],+ ..PlayIntegrityConfig::default()+ }+ }++ fn passing() -> Value {+ json!({+ "requestDetails": {+ "requestPackageName": PACKAGE,+ "requestHash": request_hash(CLIENT_DATA),+ "timestampMillis": (NOW_MS - 2_000).to_string()+ },+ "appIntegrity": {+ "appRecognitionVerdict": "PLAY_RECOGNIZED",+ "packageName": PACKAGE,+ "certificateSha256Digest": [URL_SAFE_NO_PAD.encode(cert())],+ "versionCode": "42"+ },+ "deviceIntegrity": {"deviceRecognitionVerdict": ["MEETS_DEVICE_INTEGRITY"]},+ "accountDetails": {"appLicensingVerdict": "LICENSED"},+ "environmentDetails": {"playProtectVerdict": "NO_ISSUES"}+ })+ }++ fn verify(payload: Value) -> Result<(), PlayIntegrityRejection> {+ verify_payload(+ payload,+ PACKAGE,+ &request_hash(CLIENT_DATA),+ &config(),+ NOW_MS,+ )+ }++ fn with(mut payload: Value, pointer: &str, value: Value) -> Value {+ *payload.pointer_mut(pointer).unwrap() = value;+ payload+ }++ #[test]+ fn accepts_a_genuine_play_verdict() {+ assert_eq!(verify(passing()), Ok(()));+ }++ #[test]+ fn rejects_an_unknown_signing_certificate() {+ let payload = with(+ passing(),+ "/appIntegrity/certificateSha256Digest",+ json!([URL_SAFE_NO_PAD.encode(sha256(b"someone else"))]),+ );+ assert_eq!(+ verify(payload),+ Err(PlayIntegrityRejection::AppNotRecognized)+ );+ }++ #[test]+ fn rejects_a_request_hash_for_other_client_data() {+ let other = request_hash(+ br#"{"challenge":"c","age_lower":13,"age_upper":15,"age_range_source":"tier_c"}"#,+ );+ let payload = with(passing(), "/requestDetails/requestHash", json!(other));+ assert_eq!(verify(payload), Err(PlayIntegrityRejection::InvalidToken));+ let mut payload = passing();+ payload["requestDetails"]+ .as_object_mut()+ .unwrap()+ .remove("requestHash");+ assert_eq!(verify(payload), Err(PlayIntegrityRejection::InvalidToken));+ }++ #[test]+ fn maps_age_bands_to_floors() {+ let floor = |lower: u8, upper: Option<u8>| {+ AgeSignalsClientData {+ challenge: String::new(),+ age_lower: lower,+ age_upper: upper,+ _age_range_source: AgeRangeSource::TierA,+ }+ .age_floor()+ };+ assert_eq!(floor(18, None), Some(AgeFloor::Adult));+ assert_eq!(floor(16, Some(17)), Some(AgeFloor::Minor));+ assert_eq!(floor(15, None), Some(AgeFloor::Minor));+ assert_eq!(floor(13, Some(15)), Some(AgeFloor::Minor));+ assert_eq!(floor(11, Some(14)), Some(AgeFloor::UnderMinimum));+ assert_eq!(floor(0, Some(12)), Some(AgeFloor::UnderMinimum));+ assert_eq!(floor(16, Some(15)), None);+ assert_eq!(floor(18, Some(17)), None);+ assert_eq!(floor(19, None), None);+ }+}diff --git a/fluxer_users/src/router_impl.rs b/fluxer_users/src/router_impl.rsindex ae8573cfa..3979483de 100644--- a/fluxer_users/src/router_impl.rs+++ b/fluxer_users/src/router_impl.rs@@ -20,7 +20,9 @@ impl RouterService for UsersRouter {UserRequest::Invalidate { user_id }| UserRequest::AppAttestCreateChallenge { user_id, .. }| UserRequest::AppAttestRegisterKey { user_id, .. }- | UserRequest::AppAttestSubmitAge { user_id, .. } => user_id.to_string(),+ | UserRequest::AppAttestSubmitAge { user_id, .. }+ | UserRequest::PlayIntegrityCreateChallenge { user_id }+ | UserRequest::PlayIntegritySubmitAge { user_id, .. } => user_id.to_string(),UserRequest::GetPartialsByIds { user_ids, .. } => user_ids.iter().min()@@ -63,7 +65,9 @@ impl RouterService for UsersRouter {UserRequest::Invalidate { .. }| UserRequest::AppAttestCreateChallenge { .. }| UserRequest::AppAttestRegisterKey { .. }- | UserRequest::AppAttestSubmitAge { .. } => None,+ | UserRequest::AppAttestSubmitAge { .. }+ | UserRequest::PlayIntegrityCreateChallenge { .. }+ | UserRequest::PlayIntegritySubmitAge { .. } => None,}}diff --git a/fluxer_users/src/shard_impl.rs b/fluxer_users/src/shard_impl.rsindex 41820eb8d..94c3f5b0d 100644--- a/fluxer_users/src/shard_impl.rs+++ b/fluxer_users/src/shard_impl.rs@@ -3,6 +3,8 @@use crate::app_attest::AppAttestConfig;use crate::app_attest::service::AppAttestService;use crate::app_attest::store::AppAttestStore;+use crate::play_integrity::PlayIntegrityConfig;+use crate::play_integrity::service::PlayIntegrityService;use crate::types::{ApiUserPartial, UserPartial, UserRequest, UserResponse};#[cfg(feature = "scylla")]use chrono::{DateTime, Utc};@@ -49,6 +51,7 @@ pub struct UsersShard {storage: UsersStorage,caches: UserCaches,app_attest: AppAttestService,+ play_integrity: PlayIntegrityService,}struct UserCaches {@@ -239,12 +242,15 @@ impl UsersShard {max_entries: u64,ttl: Duration,app_attest: AppAttestConfig,- ) -> Self {- Self {- app_attest: AppAttestService::new(app_attest, AppAttestStore::Postgres(kv.clone())),+ play_integrity: PlayIntegrityConfig,+ ) -> anyhow::Result<Self> {+ let store = AppAttestStore::Postgres(kv.clone());+ Ok(Self {+ play_integrity: PlayIntegrityService::new(play_integrity, store.clone())?,+ app_attest: AppAttestService::new(app_attest, store),storage: UsersStorage::Postgres(PostgresUsersStorage { kv }),caches: UserCaches::new(max_entries, ttl),- }+ })}#[cfg(feature = "scylla")]@@ -253,6 +259,7 @@ impl UsersShard {max_entries: u64,ttl: Duration,app_attest: AppAttestConfig,+ play_integrity: PlayIntegrityConfig,) -> anyhow::Result<Self> {let stmt_partial = db.prepare(format!(@@ -269,6 +276,7 @@ impl UsersShard {crate::app_attest::store::ScyllaAppAttestStore::new(db.clone()),));Ok(Self {+ play_integrity: PlayIntegrityService::new(play_integrity, app_attest_store.clone())?,app_attest: AppAttestService::new(app_attest, app_attest_store),storage: UsersStorage::Scylla(Arc::new(ScyllaUsersStorage {db,@@ -575,6 +583,27 @@ impl ShardService for UsersShard {).await}+ UserRequest::PlayIntegrityCreateChallenge { user_id } => {+ self.play_integrity+ .create_challenge(user_id, SystemTime::now())+ .await+ }+ UserRequest::PlayIntegritySubmitAge {+ user_id,+ package_name,+ integrity_token,+ client_data_base64,+ } => {+ self.play_integrity+ .submit_age(+ user_id,+ &package_name,+ &integrity_token,+ &client_data_base64,+ SystemTime::now(),+ )+ .await+ }}}}diff --git a/fluxer_users/src/types.rs b/fluxer_users/src/types.rsindex a632aba63..558077e39 100644--- a/fluxer_users/src/types.rs+++ b/fluxer_users/src/types.rs@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-or-lateruse crate::app_attest::{AgeFloor, AppAttestRejection, ChallengePurpose};+use crate::play_integrity::PlayIntegrityRejection;use crate::pseudonym::pseudonym;use fluxer_common::user_flags::AccountStanding;#[cfg(test)]@@ -47,6 +48,17 @@ pub enum UserRequest {assertion_base64: String,client_data_base64: String,},+ PlayIntegrityCreateChallenge {+ #[serde(deserialize_with = "deserialize_i64_from_number_or_string")]+ user_id: i64,+ },+ PlayIntegritySubmitAge {+ #[serde(deserialize_with = "deserialize_i64_from_number_or_string")]+ user_id: i64,+ package_name: String,+ integrity_token: String,+ client_data_base64: String,+ },}#[derive(Debug, Clone, Serialize, Deserialize)]@@ -67,6 +79,9 @@ pub enum UserResponse {AppAttestRejected {code: AppAttestRejection,},+ PlayIntegrityRejected {+ code: PlayIntegrityRejection,+ },}#[derive(Debug, Clone, Serialize, Deserialize)]diff --git a/packages/constants/src/AgeAssuranceConstants.ts b/packages/constants/src/AgeAssuranceConstants.tsindex 84c198eb2..21800bcfa 100644--- a/packages/constants/src/AgeAssuranceConstants.ts+++ b/packages/constants/src/AgeAssuranceConstants.ts@@ -28,3 +28,6 @@ export const APP_ATTEST_CHALLENGE_BYTES = 32;export const APP_ATTEST_ATTESTATION_MAX_BYTES = 16 * 1024;export const APP_ATTEST_ASSERTION_MAX_BYTES = 4 * 1024;export const APP_ATTEST_CLIENT_DATA_MAX_BYTES = 1024;+export const PLAY_INTEGRITY_PACKAGE_NAME_MAX_LENGTH = 255;+export const PLAY_INTEGRITY_TOKEN_MAX_LENGTH = 16 * 1024;+export const PLAY_INTEGRITY_CLIENT_DATA_MAX_BYTES = 1024;diff --git a/packages/constants/src/ApiErrorCodes.ts b/packages/constants/src/ApiErrorCodes.tsindex 53f4b92d6..2b4bbbc34 100644--- a/packages/constants/src/ApiErrorCodes.ts+++ b/packages/constants/src/ApiErrorCodes.ts@@ -24,6 +24,13 @@ export const APIErrorCodes = {APP_ATTEST_ATTESTATION_INVALID: 'APP_ATTEST_ATTESTATION_INVALID',APP_ATTEST_ASSERTION_INVALID: 'APP_ATTEST_ASSERTION_INVALID',APP_ATTEST_REQUEST_INVALID: 'APP_ATTEST_REQUEST_INVALID',+ PLAY_INTEGRITY_NOT_AVAILABLE: 'PLAY_INTEGRITY_NOT_AVAILABLE',+ PLAY_INTEGRITY_REQUEST_INVALID: 'PLAY_INTEGRITY_REQUEST_INVALID',+ PLAY_INTEGRITY_CHALLENGE_INVALID: 'PLAY_INTEGRITY_CHALLENGE_INVALID',+ PLAY_INTEGRITY_TOKEN_INVALID: 'PLAY_INTEGRITY_TOKEN_INVALID',+ PLAY_INTEGRITY_APP_NOT_RECOGNIZED: 'PLAY_INTEGRITY_APP_NOT_RECOGNIZED',+ PLAY_INTEGRITY_DEVICE_NOT_TRUSTED: 'PLAY_INTEGRITY_DEVICE_NOT_TRUSTED',+ PLAY_INTEGRITY_UNAVAILABLE: 'PLAY_INTEGRITY_UNAVAILABLE',BOTS_CANNOT_CREATE_GUILDS: 'BOTS_CANNOT_CREATE_GUILDS',BOTS_CANNOT_SEND_FRIEND_REQUESTS: 'BOTS_CANNOT_SEND_FRIEND_REQUESTS',BOT_ALREADY_IN_GUILD: 'BOT_ALREADY_IN_GUILD',diff --git a/packages/errors/src/domains/user/PlayIntegrityAppNotRecognizedError.ts b/packages/errors/src/domains/user/PlayIntegrityAppNotRecognizedError.tsnew file mode 100644index 000000000..86e9b67db--- /dev/null+++ b/packages/errors/src/domains/user/PlayIntegrityAppNotRecognizedError.ts@@ -0,0 +1,10 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';+import {BadRequestError} from '@fluxer/errors/src/domains/core/BadRequestError';++export class PlayIntegrityAppNotRecognizedError extends BadRequestError {+ constructor() {+ super({code: APIErrorCodes.PLAY_INTEGRITY_APP_NOT_RECOGNIZED});+ }+}diff --git a/packages/errors/src/domains/user/PlayIntegrityChallengeInvalidError.ts b/packages/errors/src/domains/user/PlayIntegrityChallengeInvalidError.tsnew file mode 100644index 000000000..fff1b15d5--- /dev/null+++ b/packages/errors/src/domains/user/PlayIntegrityChallengeInvalidError.ts@@ -0,0 +1,10 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';+import {BadRequestError} from '@fluxer/errors/src/domains/core/BadRequestError';++export class PlayIntegrityChallengeInvalidError extends BadRequestError {+ constructor() {+ super({code: APIErrorCodes.PLAY_INTEGRITY_CHALLENGE_INVALID});+ }+}diff --git a/packages/errors/src/domains/user/PlayIntegrityDeviceNotTrustedError.ts b/packages/errors/src/domains/user/PlayIntegrityDeviceNotTrustedError.tsnew file mode 100644index 000000000..8fbf28740--- /dev/null+++ b/packages/errors/src/domains/user/PlayIntegrityDeviceNotTrustedError.ts@@ -0,0 +1,10 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';+import {BadRequestError} from '@fluxer/errors/src/domains/core/BadRequestError';++export class PlayIntegrityDeviceNotTrustedError extends BadRequestError {+ constructor() {+ super({code: APIErrorCodes.PLAY_INTEGRITY_DEVICE_NOT_TRUSTED});+ }+}diff --git a/packages/errors/src/domains/user/PlayIntegrityNotAvailableError.ts b/packages/errors/src/domains/user/PlayIntegrityNotAvailableError.tsnew file mode 100644index 000000000..b356d42ee--- /dev/null+++ b/packages/errors/src/domains/user/PlayIntegrityNotAvailableError.ts@@ -0,0 +1,10 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';+import {NotFoundError} from '@fluxer/errors/src/domains/core/NotFoundError';++export class PlayIntegrityNotAvailableError extends NotFoundError {+ constructor() {+ super({code: APIErrorCodes.PLAY_INTEGRITY_NOT_AVAILABLE});+ }+}diff --git a/packages/errors/src/domains/user/PlayIntegrityRequestInvalidError.ts b/packages/errors/src/domains/user/PlayIntegrityRequestInvalidError.tsnew file mode 100644index 000000000..0090ff995--- /dev/null+++ b/packages/errors/src/domains/user/PlayIntegrityRequestInvalidError.ts@@ -0,0 +1,10 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';+import {BadRequestError} from '@fluxer/errors/src/domains/core/BadRequestError';++export class PlayIntegrityRequestInvalidError extends BadRequestError {+ constructor() {+ super({code: APIErrorCodes.PLAY_INTEGRITY_REQUEST_INVALID});+ }+}diff --git a/packages/errors/src/domains/user/PlayIntegrityTokenInvalidError.ts b/packages/errors/src/domains/user/PlayIntegrityTokenInvalidError.tsnew file mode 100644index 000000000..54cdbfbe9--- /dev/null+++ b/packages/errors/src/domains/user/PlayIntegrityTokenInvalidError.ts@@ -0,0 +1,10 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';+import {BadRequestError} from '@fluxer/errors/src/domains/core/BadRequestError';++export class PlayIntegrityTokenInvalidError extends BadRequestError {+ constructor() {+ super({code: APIErrorCodes.PLAY_INTEGRITY_TOKEN_INVALID});+ }+}diff --git a/packages/errors/src/domains/user/PlayIntegrityUnavailableError.ts b/packages/errors/src/domains/user/PlayIntegrityUnavailableError.tsnew file mode 100644index 000000000..76914088f--- /dev/null+++ b/packages/errors/src/domains/user/PlayIntegrityUnavailableError.ts@@ -0,0 +1,10 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';+import {ServiceUnavailableError} from '@fluxer/errors/src/domains/core/ServiceUnavailableError';++export class PlayIntegrityUnavailableError extends ServiceUnavailableError {+ constructor() {+ super({code: APIErrorCodes.PLAY_INTEGRITY_UNAVAILABLE});+ }+}diff --git a/packages/errors/src/i18n/ErrorCodeMappings.ts b/packages/errors/src/i18n/ErrorCodeMappings.tsindex f715418ab..413b7708b 100644--- a/packages/errors/src/i18n/ErrorCodeMappings.ts+++ b/packages/errors/src/i18n/ErrorCodeMappings.ts@@ -18,6 +18,13 @@ export const ErrorCodeToI18nKey = {[APIErrorCodes.APP_ATTEST_ATTESTATION_INVALID]: 'account.app_attest_attestation_invalid',[APIErrorCodes.APP_ATTEST_ASSERTION_INVALID]: 'account.app_attest_assertion_invalid',[APIErrorCodes.APP_ATTEST_REQUEST_INVALID]: 'account.app_attest_request_invalid',+ [APIErrorCodes.PLAY_INTEGRITY_NOT_AVAILABLE]: 'account.play_integrity_not_available',+ [APIErrorCodes.PLAY_INTEGRITY_REQUEST_INVALID]: 'account.play_integrity_request_invalid',+ [APIErrorCodes.PLAY_INTEGRITY_CHALLENGE_INVALID]: 'account.play_integrity_challenge_invalid',+ [APIErrorCodes.PLAY_INTEGRITY_TOKEN_INVALID]: 'account.play_integrity_token_invalid',+ [APIErrorCodes.PLAY_INTEGRITY_APP_NOT_RECOGNIZED]: 'account.play_integrity_app_not_recognized',+ [APIErrorCodes.PLAY_INTEGRITY_DEVICE_NOT_TRUSTED]: 'account.play_integrity_device_not_trusted',+ [APIErrorCodes.PLAY_INTEGRITY_UNAVAILABLE]: 'account.play_integrity_unavailable',[APIErrorCodes.ACCOUNT_VERIFICATION_REQUIRED]: 'account.verification_required',[APIErrorCodes.DATE_OF_BIRTH_REQUIRED]: 'account.date_of_birth_required',[APIErrorCodes.DATE_OF_BIRTH_ALREADY_SET]: 'account.date_of_birth_already_set',diff --git a/packages/errors/src/i18n/ErrorI18nMessages.ts b/packages/errors/src/i18n/ErrorI18nMessages.tsindex b86b86886..b97b49c89 100644--- a/packages/errors/src/i18n/ErrorI18nMessages.ts+++ b/packages/errors/src/i18n/ErrorI18nMessages.ts@@ -14,6 +14,15 @@ export const ERROR_I18N_MESSAGES = {'account.date_of_birth_required': 'Enter your date of birth to continue.','account.password_required_to_claim':"{reason, select, email_delivery_off {Set a password to keep this account. This instance can't send email codes.} local_credential_basis {Set a password to keep this account. This instance asks every account for a password or passkey.} other {Set a password to keep this account.}}",+ 'account.play_integrity_app_not_recognized':+ 'Install the app from Google Play and sign in to Google Play to check your age in the app.',+ 'account.play_integrity_challenge_invalid': 'This check has expired or was already used. Try again.',+ 'account.play_integrity_device_not_trusted':+ "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ 'account.play_integrity_not_available': "Age checks from the Android app aren't available on this instance.",+ 'account.play_integrity_request_invalid': "This age check request isn't valid.",+ 'account.play_integrity_token_invalid': "We couldn't confirm this age check from your device. Try again.",+ 'account.play_integrity_unavailable': "We couldn't connect to Google Play to check your age. Try again later.",'account.unclaimed_cannot_accept_friend_requests': 'Claim your account to accept friend requests.','account.unclaimed_cannot_add_reactions': 'Claim your account to add reactions.','account.unclaimed_cannot_create_applications': 'Claim your account to create applications.',diff --git a/packages/errors/src/i18n/weblate/locales/ar.json b/packages/errors/src/i18n/weblate/locales/ar.jsonindex 941732f71..d39cd1e38 100644--- a/packages/errors/src/i18n/weblate/locales/ar.json+++ b/packages/errors/src/i18n/weblate/locales/ar.json@@ -17,6 +17,13 @@"account.limited": "إرسال الرسائل متوقف مؤقتًا في حسابك. ستجد في بريدك الإلكتروني خطوة سريعة واحدة للمتابعة.","account.mfa_email_verification_required": "أكّد عنوان بريدك الإلكتروني لاستخدام المصادقة الثنائية أو مفاتيح المرور.","account.password_required_to_claim": "{reason, select, email_delivery_off {عيّن كلمة مرور للاحتفاظ بهذا الحساب. لا يمكن لهذا المثيل إرسال رموز البريد الإلكتروني.} local_credential_basis {عيّن كلمة مرور للاحتفاظ بهذا الحساب. يطلب هذا المثيل كلمة مرور أو مفتاح مرور لكل حساب.} other {عيّن كلمة مرور للاحتفاظ بهذا الحساب.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "فلتر المحتوى الحساس هذا غير متاح لفئتك العمرية.","account.session_timeout": "انتهت صلاحية الجلسة. حدّث الصفحة وسجّل الدخول مرة أخرى.","account.session_token_mismatch": "عدم تطابق رمز الجلسة.",diff --git a/packages/errors/src/i18n/weblate/locales/bg.json b/packages/errors/src/i18n/weblate/locales/bg.jsonindex 352ad8a89..f8848f529 100644--- a/packages/errors/src/i18n/weblate/locales/bg.json+++ b/packages/errors/src/i18n/weblate/locales/bg.json@@ -17,6 +17,13 @@"account.limited": "Изпращането на съобщения от акаунта ти е на пауза. Погледни имейла си: остава само една бърза стъпка, за да продължиш.","account.mfa_email_verification_required": "Потвърди имейл адреса си, за да използваш двуфакторно удостоверяване или ключове за достъп.","account.password_required_to_claim": "{reason, select, email_delivery_off {Задай парола, за да запазиш този акаунт. Тази инстанция не може да изпраща кодове по имейл.} local_credential_basis {Задай парола, за да запазиш този акаунт. Тази инстанция изисква парола или ключ за достъп за всеки акаунт.} other {Задай парола, за да запазиш този акаунт.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Този филтър за чувствително съдържание не е наличен за твоята възрастова група.","account.session_timeout": "Сесията изтече. Презареди страницата и влез отново.","account.session_token_mismatch": "Несъответствие на токена за сесия.",diff --git a/packages/errors/src/i18n/weblate/locales/cs.json b/packages/errors/src/i18n/weblate/locales/cs.jsonindex 4ed5f0afd..9a5a228c2 100644--- a/packages/errors/src/i18n/weblate/locales/cs.json+++ b/packages/errors/src/i18n/weblate/locales/cs.json@@ -17,6 +17,13 @@"account.limited": "U vašeho účtu je posílání zpráv na pauze. Podívejte se do e-mailu: stačí jeden rychlý krok a můžete pokračovat.","account.mfa_email_verification_required": "Potvrďte svou e-mailovou adresu, abyste mohli používat dvoufaktorové ověřování nebo přístupové klíče.","account.password_required_to_claim": "{reason, select, email_delivery_off {Nastavte si heslo, abyste si tento účet ponechali. Tato instance nemůže odesílat e-mailové kódy.} local_credential_basis {Nastavte si heslo, abyste si tento účet ponechali. Tato instance vyžaduje u každého účtu heslo nebo přístupový klíč.} other {Nastavte si heslo, abyste si tento účet ponechali.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Tento filtr citlivého obsahu není pro vaši věkovou skupinu dostupný.","account.session_timeout": "Platnost relace vypršela. Obnovte stránku a přihlaste se znovu.","account.session_token_mismatch": "Token relace nesouhlasí.",diff --git a/packages/errors/src/i18n/weblate/locales/da.json b/packages/errors/src/i18n/weblate/locales/da.jsonindex 1e3c98cb8..847a60df9 100644--- a/packages/errors/src/i18n/weblate/locales/da.json+++ b/packages/errors/src/i18n/weblate/locales/da.json@@ -17,6 +17,13 @@"account.limited": "Beskeder er sat på pause på din konto. Tjek din e-mail for et hurtigt trin, så du kan fortsætte.","account.mfa_email_verification_required": "Bekræft din e-mailadresse for at bruge tofaktorgodkendelse eller adgangsnøgler.","account.password_required_to_claim": "{reason, select, email_delivery_off {Vælg en adgangskode for at beholde denne konto. Denne instans kan ikke sende e-mail-koder.} local_credential_basis {Vælg en adgangskode for at beholde denne konto. Denne instans kræver en adgangskode eller adgangsnøgle på alle konti.} other {Vælg en adgangskode for at beholde denne konto.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Dette filter til følsomt indhold er ikke tilgængeligt for din aldersgruppe.","account.session_timeout": "Sessionen er udløbet. Opdater siden, og log ind igen.","account.session_token_mismatch": "Sessionstokenet stemmer ikke overens.",diff --git a/packages/errors/src/i18n/weblate/locales/de.json b/packages/errors/src/i18n/weblate/locales/de.jsonindex 68ed2a3cb..9f248ccf8 100644--- a/packages/errors/src/i18n/weblate/locales/de.json+++ b/packages/errors/src/i18n/weblate/locales/de.json@@ -17,6 +17,13 @@"account.limited": "Das Senden von Nachrichten ist für deinen Account pausiert. Schau in deine E-Mails, dort erfährst du, wie es mit einem kurzen Schritt weitergeht.","account.mfa_email_verification_required": "Bestätige deine E-Mail-Adresse, um die Zwei-Faktor-Authentifizierung oder Passkeys zu nutzen.","account.password_required_to_claim": "{reason, select, email_delivery_off {Lege ein Passwort fest, um diesen Account zu behalten. Diese Instanz kann keine E-Mail-Codes senden.} local_credential_basis {Lege ein Passwort fest, um diesen Account zu behalten. Diese Instanz verlangt für jeden Account ein Passwort oder einen Passkey.} other {Lege ein Passwort fest, um diesen Account zu behalten.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Dieser Filter für sensible Inhalte ist für deine Altersgruppe nicht verfügbar.","account.session_timeout": "Sitzung abgelaufen. Lade die Seite neu und melde dich erneut an.","account.session_token_mismatch": "Das Sitzungstoken stimmt nicht überein.",diff --git a/packages/errors/src/i18n/weblate/locales/el.json b/packages/errors/src/i18n/weblate/locales/el.jsonindex e5a09d84d..ef3072de2 100644--- a/packages/errors/src/i18n/weblate/locales/el.json+++ b/packages/errors/src/i18n/weblate/locales/el.json@@ -17,6 +17,13 @@"account.limited": "Η αποστολή μηνυμάτων από τον λογαριασμό σας είναι σε παύση. Ελέγξτε το email σας: ένα γρήγορο βήμα αρκεί για να συνεχίσετε.","account.mfa_email_verification_required": "Επιβεβαιώστε τη διεύθυνση email σας για να χρησιμοποιήσετε τον έλεγχο ταυτότητας δύο παραγόντων ή κλειδιά πρόσβασης.","account.password_required_to_claim": "{reason, select, email_delivery_off {Ορίστε έναν κωδικό πρόσβασης για να κρατήσετε αυτόν τον λογαριασμό. Αυτή η παρουσία δεν μπορεί να στείλει κωδικούς μέσω email.} local_credential_basis {Ορίστε έναν κωδικό πρόσβασης για να κρατήσετε αυτόν τον λογαριασμό. Αυτή η παρουσία ζητά κωδικό πρόσβασης ή κλειδί πρόσβασης για κάθε λογαριασμό.} other {Ορίστε έναν κωδικό πρόσβασης για να κρατήσετε αυτόν τον λογαριασμό.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Αυτό το φίλτρο ευαίσθητου περιεχομένου δεν είναι διαθέσιμο για την ηλικιακή σου ομάδα.","account.session_timeout": "Η συνεδρία έληξε. Ανανέωσε τη σελίδα και συνδέσου ξανά.","account.session_token_mismatch": "Ασυμφωνία token συνεδρίας.",diff --git a/packages/errors/src/i18n/weblate/locales/en-GB.json b/packages/errors/src/i18n/weblate/locales/en-GB.jsonindex 7c5faaf27..563664d73 100644--- a/packages/errors/src/i18n/weblate/locales/en-GB.json+++ b/packages/errors/src/i18n/weblate/locales/en-GB.json@@ -17,6 +17,13 @@"account.limited": "Messaging is paused on your account. Check your email for a quick step to continue.","account.mfa_email_verification_required": "Confirm your email address to use two-factor authentication or passkeys.","account.password_required_to_claim": "{reason, select, email_delivery_off {Set a password to keep this account. This instance can't send email codes.} local_credential_basis {Set a password to keep this account. This instance asks every account for a password or passkey.} other {Set a password to keep this account.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "This sensitive content filter isn't available for your age group.","account.session_timeout": "Session timed out. Refresh the page and log in again.","account.session_token_mismatch": "Session token mismatch.",diff --git a/packages/errors/src/i18n/weblate/locales/es-419.json b/packages/errors/src/i18n/weblate/locales/es-419.jsonindex 7c6bfb800..e73e238b5 100644--- a/packages/errors/src/i18n/weblate/locales/es-419.json+++ b/packages/errors/src/i18n/weblate/locales/es-419.json@@ -17,6 +17,13 @@"account.limited": "El envío de mensajes está en pausa en tu cuenta. Revisa tu correo para completar un paso rápido y continuar.","account.mfa_email_verification_required": "Confirma tu dirección de correo electrónico para usar la autenticación de dos factores o las llaves de acceso.","account.password_required_to_claim": "{reason, select, email_delivery_off {Crea una contraseña para conservar esta cuenta. Esta instancia no puede enviar códigos por correo electrónico.} local_credential_basis {Crea una contraseña para conservar esta cuenta. Esta instancia pide una contraseña o una llave de acceso en todas las cuentas.} other {Crea una contraseña para conservar esta cuenta.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Este filtro de contenido sensible no está disponible para tu edad.","account.session_timeout": "Tu sesión expiró. Actualiza la página e inicia sesión de nuevo.","account.session_token_mismatch": "El token de sesión no coincide.",diff --git a/packages/errors/src/i18n/weblate/locales/es-ES.json b/packages/errors/src/i18n/weblate/locales/es-ES.jsonindex cceaec061..a9d7fc4e6 100644--- a/packages/errors/src/i18n/weblate/locales/es-ES.json+++ b/packages/errors/src/i18n/weblate/locales/es-ES.json@@ -17,6 +17,13 @@"account.limited": "El envío de mensajes está en pausa en tu cuenta. Revisa tu correo electrónico para completar un paso rápido y continuar.","account.mfa_email_verification_required": "Confirma tu dirección de correo electrónico para usar la autenticación de dos factores o las claves de acceso.","account.password_required_to_claim": "{reason, select, email_delivery_off {Crea una contraseña para conservar esta cuenta. Esta instancia no puede enviar códigos por correo electrónico.} local_credential_basis {Crea una contraseña para conservar esta cuenta. Esta instancia pide una contraseña o una clave de acceso en todas las cuentas.} other {Crea una contraseña para conservar esta cuenta.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Este filtro de contenido sensible no está disponible para tu edad.","account.session_timeout": "La sesión ha caducado. Actualiza la página e inicia sesión de nuevo.","account.session_token_mismatch": "El token de sesión no coincide.",diff --git a/packages/errors/src/i18n/weblate/locales/fi.json b/packages/errors/src/i18n/weblate/locales/fi.jsonindex 920045dd0..bfcc615c3 100644--- a/packages/errors/src/i18n/weblate/locales/fi.json+++ b/packages/errors/src/i18n/weblate/locales/fi.json@@ -17,6 +17,13 @@"account.limited": "Viestien lähettäminen on tililläsi tauolla. Löydät sähköpostistasi yhden nopean vaiheen, jolla pääset jatkamaan.","account.mfa_email_verification_required": "Vahvista sähköpostiosoitteesi käyttääksesi kaksivaiheista todennusta tai pääsyavaimia.","account.password_required_to_claim": "{reason, select, email_delivery_off {Aseta salasana, jotta voit pitää tämän tilin. Tämä instanssi ei voi lähettää sähköpostikoodeja.} local_credential_basis {Aseta salasana, jotta voit pitää tämän tilin. Tämä instanssi vaatii jokaiselta tililtä salasanan tai pääsyavaimen.} other {Aseta salasana, jotta voit pitää tämän tilin.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Tätä arkaluontoista sisältöä koskevaa suodatinta ei ole saatavilla ikäsi vuoksi.","account.session_timeout": "Istunto aikakatkesi. Päivitä sivu ja kirjaudu sisään uudelleen.","account.session_token_mismatch": "Istuntotunnus ei täsmää.",diff --git a/packages/errors/src/i18n/weblate/locales/fr.json b/packages/errors/src/i18n/weblate/locales/fr.jsonindex e01508fef..279a958f1 100644--- a/packages/errors/src/i18n/weblate/locales/fr.json+++ b/packages/errors/src/i18n/weblate/locales/fr.json@@ -17,6 +17,13 @@"account.limited": "L'envoi de messages a été mis en pause sur votre compte. Consultez vos e-mails pour savoir comment y remédier en une étape rapide.","account.mfa_email_verification_required": "Confirmez votre adresse e-mail pour utiliser l'authentification à deux facteurs ou les clés d'accès.","account.password_required_to_claim": "{reason, select, email_delivery_off {Définissez un mot de passe pour conserver ce compte. Cette instance ne peut pas envoyer de codes par e-mail.} local_credential_basis {Définissez un mot de passe pour conserver ce compte. Cette instance demande un mot de passe ou une clé d'accès pour chaque compte.} other {Définissez un mot de passe pour conserver ce compte.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Ce filtre de contenu sensible n’est pas disponible pour votre tranche d’âge.","account.session_timeout": "La session a expiré. Actualisez la page et reconnectez-vous.","account.session_token_mismatch": "Incompatibilité du jeton de session.",diff --git a/packages/errors/src/i18n/weblate/locales/he.json b/packages/errors/src/i18n/weblate/locales/he.jsonindex cdccba7e0..3efb0583a 100644--- a/packages/errors/src/i18n/weblate/locales/he.json+++ b/packages/errors/src/i18n/weblate/locales/he.json@@ -17,6 +17,13 @@"account.limited": "שליחת ההודעות בחשבון שלך מושהית כרגע. באימייל שלך מחכה לך שלב קצר אחד כדי להמשיך.","account.mfa_email_verification_required": "יש לאשר את כתובת האימייל שלך כדי להשתמש באימות דו-שלבי או במפתחות גישה.","account.password_required_to_claim": "{reason, select, email_delivery_off {הגדר סיסמה כדי לשמור את החשבון הזה. המופע הזה לא יכול לשלוח קודים באימייל.} local_credential_basis {הגדר סיסמה כדי לשמור את החשבון הזה. המופע הזה דורש סיסמה או מפתח גישה בכל חשבון.} other {הגדר סיסמה כדי לשמור את החשבון הזה.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "מסנן התוכן הרגיש הזה אינו זמין לקבוצת הגיל שלך.","account.session_timeout": "הסשן פג. יש לרענן את הדף ולהתחבר שוב.","account.session_token_mismatch": "אי-התאמה באסימון הסשן.",diff --git a/packages/errors/src/i18n/weblate/locales/hi.json b/packages/errors/src/i18n/weblate/locales/hi.jsonindex d7bf8f9c4..7ac0470cd 100644--- a/packages/errors/src/i18n/weblate/locales/hi.json+++ b/packages/errors/src/i18n/weblate/locales/hi.json@@ -17,6 +17,13 @@"account.limited": "आपके अकाउंट पर मैसेजिंग अभी रुकी हुई है। आगे बढ़ने के लिए अपना ईमेल देखें, बस एक आसान स्टेप पूरा करना है।","account.mfa_email_verification_required": "दो-कारक प्रमाणीकरण या पासकी का उपयोग करने के लिए अपना ईमेल पता कन्फ़र्म करें।","account.password_required_to_claim": "{reason, select, email_delivery_off {यह अकाउंट बनाए रखने के लिए पासवर्ड सेट करें। यह इंस्टेंस ईमेल कोड नहीं भेज सकता।} local_credential_basis {यह अकाउंट बनाए रखने के लिए पासवर्ड सेट करें। यह इंस्टेंस हर अकाउंट के लिए पासवर्ड या पासकी माँगता है।} other {यह अकाउंट बनाए रखने के लिए पासवर्ड सेट करें।}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "यह संवेदनशील सामग्री फ़िल्टर आपके उम्र वर्ग के लिए उपलब्ध नहीं है।","account.session_timeout": "सेशन टाइमआउट हो गया है। पेज रिफ़्रेश करें और दोबारा लॉगिन करें।","account.session_token_mismatch": "सेशन टोकन मेल नहीं खा रहा।",diff --git a/packages/errors/src/i18n/weblate/locales/hr.json b/packages/errors/src/i18n/weblate/locales/hr.jsonindex 40a9fcf7c..b16183a9b 100644--- a/packages/errors/src/i18n/weblate/locales/hr.json+++ b/packages/errors/src/i18n/weblate/locales/hr.json@@ -17,6 +17,13 @@"account.limited": "Slanje poruka na vašem računu je pauzirano. Pogledajte e-poštu: dovoljan je jedan brzi korak za nastavak.","account.mfa_email_verification_required": "Potvrdite svoju adresu e-pošte kako biste mogli koristiti dvostruku provjeru autentičnosti ili pristupne ključeve.","account.password_required_to_claim": "{reason, select, email_delivery_off {Postavite lozinku kako biste zadržali ovaj račun. Ova instanca ne može slati kodove putem e-pošte.} local_credential_basis {Postavite lozinku kako biste zadržali ovaj račun. Ova instanca traži lozinku ili pristupni ključ za svaki račun.} other {Postavite lozinku kako biste zadržali ovaj račun.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Ovaj filtar osjetljivog sadržaja nije dostupan za tvoju dobnu skupinu.","account.session_timeout": "Sesija je istekla. Osvježi stranicu i prijavi se ponovno.","account.session_token_mismatch": "Token sesije se ne podudara.",diff --git a/packages/errors/src/i18n/weblate/locales/hu.json b/packages/errors/src/i18n/weblate/locales/hu.jsonindex f61320e21..3057a82c5 100644--- a/packages/errors/src/i18n/weblate/locales/hu.json+++ b/packages/errors/src/i18n/weblate/locales/hu.json@@ -17,6 +17,13 @@"account.limited": "Az üzenetküldés jelenleg szünetel a fiókodban. Nézd meg az e-mailjeidet: egy gyors lépés, és folytathatod.","account.mfa_email_verification_required": "Erősítsd meg az e-mail-címedet, hogy használhasd a kétlépcsős azonosítást vagy a jelszókulcsokat.","account.password_required_to_claim": "{reason, select, email_delivery_off {Állíts be egy jelszót, hogy megtarthasd ezt a fiókot. Ez a példány nem tud e-mail-kódokat küldeni.} local_credential_basis {Állíts be egy jelszót, hogy megtarthasd ezt a fiókot. Ez a példány minden fióktól jelszót vagy jelszókulcsot kér.} other {Állíts be egy jelszót, hogy megtarthasd ezt a fiókot.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Ez az érzékeny tartalmakat szűrő beállítás nem érhető el a korosztályodnak.","account.session_timeout": "A munkamenet lejárt. Frissítsd az oldalt, és jelentkezz be újra.","account.session_token_mismatch": "A munkamenettoken nem egyezik.",diff --git a/packages/errors/src/i18n/weblate/locales/id.json b/packages/errors/src/i18n/weblate/locales/id.jsonindex 86af17c9a..cb3ccc318 100644--- a/packages/errors/src/i18n/weblate/locales/id.json+++ b/packages/errors/src/i18n/weblate/locales/id.json@@ -17,6 +17,13 @@"account.limited": "Fitur pesan di akunmu sedang dijeda. Cek emailmu untuk satu langkah singkat agar bisa lanjut.","account.mfa_email_verification_required": "Konfirmasi alamat emailmu untuk menggunakan autentikasi dua faktor atau passkey.","account.password_required_to_claim": "{reason, select, email_delivery_off {Atur kata sandi untuk mempertahankan akun ini. Instance ini tidak dapat mengirim kode email.} local_credential_basis {Atur kata sandi untuk mempertahankan akun ini. Instance ini meminta kata sandi atau passkey untuk setiap akun.} other {Atur kata sandi untuk mempertahankan akun ini.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Filter konten sensitif ini tidak tersedia untuk kelompok usiamu.","account.session_timeout": "Sesi berakhir. Muat ulang halaman dan masuk lagi.","account.session_token_mismatch": "Token sesi tidak cocok.",diff --git a/packages/errors/src/i18n/weblate/locales/it.json b/packages/errors/src/i18n/weblate/locales/it.jsonindex 6bf2d38e8..7df7a7ad6 100644--- a/packages/errors/src/i18n/weblate/locales/it.json+++ b/packages/errors/src/i18n/weblate/locales/it.json@@ -17,6 +17,13 @@"account.limited": "L'invio di messaggi è in pausa sul tuo account. Controlla la tua email per completare un passaggio veloce e continuare.","account.mfa_email_verification_required": "Conferma il tuo indirizzo email per usare l'autenticazione a due fattori o le passkey.","account.password_required_to_claim": "{reason, select, email_delivery_off {Imposta una password per tenere questo account. Questa istanza non può inviare codici via email.} local_credential_basis {Imposta una password per tenere questo account. Questa istanza richiede una password o una passkey per ogni account.} other {Imposta una password per tenere questo account.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Questo filtro per contenuti sensibili non è disponibile per la tua età.","account.session_timeout": "Sessione scaduta. Aggiorna la pagina e accedi di nuovo.","account.session_token_mismatch": "Token di sessione non corrispondente.",diff --git a/packages/errors/src/i18n/weblate/locales/ja.json b/packages/errors/src/i18n/weblate/locales/ja.jsonindex 0672377ff..d1da3ba7e 100644--- a/packages/errors/src/i18n/weblate/locales/ja.json+++ b/packages/errors/src/i18n/weblate/locales/ja.json@@ -17,6 +17,13 @@"account.limited": "アカウントのメッセージ機能は一時停止中です。メールでご案内しているかんたんな手続きを済ませると、再開できます。","account.mfa_email_verification_required": "2段階認証またはパスキーを使用するには、メールアドレスを確認してください。","account.password_required_to_claim": "{reason, select, email_delivery_off {このアカウントを残すには、パスワードを設定してください。このインスタンスではメールコードを送信できません。} local_credential_basis {このアカウントを残すには、パスワードを設定してください。このインスタンスでは、すべてのアカウントにパスワードまたはパスキーが必要です。} other {このアカウントを残すには、パスワードを設定してください。}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "このセンシティブコンテンツフィルターは、現在の年齢層ではご利用いただけません。","account.session_timeout": "セッションがタイムアウトしました。ページを更新して、もう一度ログインしてください。","account.session_token_mismatch": "セッショントークンが一致しません。",diff --git a/packages/errors/src/i18n/weblate/locales/ko.json b/packages/errors/src/i18n/weblate/locales/ko.jsonindex 0528c3424..5479dc5ba 100644--- a/packages/errors/src/i18n/weblate/locales/ko.json+++ b/packages/errors/src/i18n/weblate/locales/ko.json@@ -17,6 +17,13 @@"account.limited": "계정의 메시지 기능이 잠시 멈춰 있어요. 이메일로 안내해 드린 간단한 단계 하나만 마치면 다시 이용할 수 있어요.","account.mfa_email_verification_required": "2단계 인증이나 패스키를 사용하려면 이메일 주소를 인증하세요.","account.password_required_to_claim": "{reason, select, email_delivery_off {이 계정을 유지하려면 비밀번호를 설정하세요. 이 인스턴스에서는 이메일 코드를 보낼 수 없어요.} local_credential_basis {이 계정을 유지하려면 비밀번호를 설정하세요. 이 인스턴스에서는 모든 계정에 비밀번호나 패스키가 필요해요.} other {이 계정을 유지하려면 비밀번호를 설정하세요.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "이 민감한 콘텐츠 필터는 현재 연령대에서는 사용할 수 없어요.","account.session_timeout": "세션이 만료되었어요. 페이지를 새로고침하고 다시 로그인해 주세요.","account.session_token_mismatch": "세션 토큰이 일치하지 않아요.",diff --git a/packages/errors/src/i18n/weblate/locales/lt.json b/packages/errors/src/i18n/weblate/locales/lt.jsonindex deea7b299..4797704ef 100644--- a/packages/errors/src/i18n/weblate/locales/lt.json+++ b/packages/errors/src/i18n/weblate/locales/lt.json@@ -17,6 +17,13 @@"account.limited": "Žinučių siuntimas jūsų paskyroje pristabdytas. Peržiūrėkite el. paštą: tęsti galėsite atlikę vieną greitą žingsnį.","account.mfa_email_verification_required": "Patvirtinkite savo el. pašto adresą, kad galėtumėte naudoti dviejų veiksnių autentifikavimą arba prieigos raktus.","account.password_required_to_claim": "{reason, select, email_delivery_off {Nustatykite slaptažodį, kad išsaugotumėte šią paskyrą. Ši instancija negali siųsti el. pašto kodų.} local_credential_basis {Nustatykite slaptažodį, kad išsaugotumėte šią paskyrą. Ši instancija reikalauja, kad kiekviena paskyra turėtų slaptažodį arba prieigos raktą.} other {Nustatykite slaptažodį, kad išsaugotumėte šią paskyrą.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Šis jautraus turinio filtras negalimas tavo amžiaus grupei.","account.session_timeout": "Seanso laikas baigėsi. Atnaujink puslapį ir prisijunk dar kartą.","account.session_token_mismatch": "Seanso žetonas neatitinka.",diff --git a/packages/errors/src/i18n/weblate/locales/nl.json b/packages/errors/src/i18n/weblate/locales/nl.jsonindex e3cbc28d8..6f75ff973 100644--- a/packages/errors/src/i18n/weblate/locales/nl.json+++ b/packages/errors/src/i18n/weblate/locales/nl.json@@ -17,6 +17,13 @@"account.limited": "Berichten sturen is gepauzeerd voor je account. Kijk in je e-mail voor één snelle stap om verder te gaan.","account.mfa_email_verification_required": "Bevestig je e-mailadres om tweefactorauthenticatie of passkeys te gebruiken.","account.password_required_to_claim": "{reason, select, email_delivery_off {Stel een wachtwoord in om dit account te houden. Deze instantie kan geen e-mailcodes versturen.} local_credential_basis {Stel een wachtwoord in om dit account te houden. Deze instantie vraagt voor elk account een wachtwoord of passkey.} other {Stel een wachtwoord in om dit account te houden.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Dit filter voor gevoelige inhoud is niet beschikbaar voor jouw leeftijdsgroep.","account.session_timeout": "Sessie is verlopen. Vernieuw de pagina en log opnieuw in.","account.session_token_mismatch": "Sessietoken komt niet overeen.",diff --git a/packages/errors/src/i18n/weblate/locales/no.json b/packages/errors/src/i18n/weblate/locales/no.jsonindex 67a0be9ac..30965718a 100644--- a/packages/errors/src/i18n/weblate/locales/no.json+++ b/packages/errors/src/i18n/weblate/locales/no.json@@ -17,6 +17,13 @@"account.limited": "Meldinger er satt på pause for kontoen din. Sjekk e-posten din for et raskt steg så du kan fortsette.","account.mfa_email_verification_required": "Bekreft e-postadressen din for å bruke tofaktorautentisering eller passnøkler.","account.password_required_to_claim": "{reason, select, email_delivery_off {Angi et passord for å beholde denne kontoen. Denne instansen kan ikke sende e-postkoder.} local_credential_basis {Angi et passord for å beholde denne kontoen. Denne instansen krever passord eller passnøkkel på alle kontoer.} other {Angi et passord for å beholde denne kontoen.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Dette filteret for sensitivt innhold er ikke tilgjengelig for aldersgruppen din.","account.session_timeout": "Økten din er utløpt. Oppdater siden og logg inn på nytt.","account.session_token_mismatch": "Økttokenet samsvarer ikke.",diff --git a/packages/errors/src/i18n/weblate/locales/pl.json b/packages/errors/src/i18n/weblate/locales/pl.jsonindex 020cd6bfd..939916749 100644--- a/packages/errors/src/i18n/weblate/locales/pl.json+++ b/packages/errors/src/i18n/weblate/locales/pl.json@@ -17,6 +17,13 @@"account.limited": "Wysyłanie wiadomości na Twoim koncie jest wstrzymane. Sprawdź e-mail i wykonaj jeden szybki krok, aby kontynuować.","account.mfa_email_verification_required": "Potwierdź swój adres e-mail, aby korzystać z uwierzytelniania dwuskładnikowego lub kluczy dostępu.","account.password_required_to_claim": "{reason, select, email_delivery_off {Ustaw hasło, aby zachować to konto. Ta instancja nie może wysyłać kodów e-mail.} local_credential_basis {Ustaw hasło, aby zachować to konto. Ta instancja wymaga hasła lub klucza dostępu na każdym koncie.} other {Ustaw hasło, aby zachować to konto.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Ten filtr treści wrażliwych nie jest dostępny dla Twojej grupy wiekowej.","account.session_timeout": "Sesja wygasła. Odśwież stronę i zaloguj się jeszcze raz.","account.session_token_mismatch": "Niezgodność tokenu sesji.",diff --git a/packages/errors/src/i18n/weblate/locales/pt-BR.json b/packages/errors/src/i18n/weblate/locales/pt-BR.jsonindex bde7b21cb..79450df1f 100644--- a/packages/errors/src/i18n/weblate/locales/pt-BR.json+++ b/packages/errors/src/i18n/weblate/locales/pt-BR.json@@ -17,6 +17,13 @@"account.limited": "O envio de mensagens está pausado na sua conta. Confira seu e-mail para concluir uma etapa rápida e continuar.","account.mfa_email_verification_required": "Confirme seu endereço de e-mail para usar a autenticação de dois fatores ou chaves de acesso.","account.password_required_to_claim": "{reason, select, email_delivery_off {Defina uma senha para manter esta conta. Esta instância não pode enviar códigos por e-mail.} local_credential_basis {Defina uma senha para manter esta conta. Esta instância exige uma senha ou chave de acesso em todas as contas.} other {Defina uma senha para manter esta conta.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Este filtro de conteúdo sensível não está disponível para sua faixa etária.","account.session_timeout": "A sessão expirou. Atualize a página e entre novamente.","account.session_token_mismatch": "Token de sessão incompatível.",diff --git a/packages/errors/src/i18n/weblate/locales/ro.json b/packages/errors/src/i18n/weblate/locales/ro.jsonindex 475fcd6ec..28db12cf7 100644--- a/packages/errors/src/i18n/weblate/locales/ro.json+++ b/packages/errors/src/i18n/weblate/locales/ro.json@@ -17,6 +17,13 @@"account.limited": "Trimiterea de mesaje este în pauză pentru contul tău. Uită-te în e-mail: te așteaptă un pas rapid ca să poți continua.","account.mfa_email_verification_required": "Confirmă-ți adresa de e-mail pentru a folosi autentificarea în doi pași sau cheile de acces.","account.password_required_to_claim": "{reason, select, email_delivery_off {Setează o parolă ca să păstrezi acest cont. Instanța aceasta nu poate trimite coduri prin e-mail.} local_credential_basis {Setează o parolă ca să păstrezi acest cont. Instanța aceasta cere o parolă sau o cheie de acces pentru fiecare cont.} other {Setează o parolă ca să păstrezi acest cont.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Acest filtru de conținut sensibil nu este disponibil pentru grupa ta de vârstă.","account.session_timeout": "Sesiunea a expirat. Reîmprospătează pagina și conectează-te din nou.","account.session_token_mismatch": "Token de sesiune necorespunzător.",diff --git a/packages/errors/src/i18n/weblate/locales/ru.json b/packages/errors/src/i18n/weblate/locales/ru.jsonindex 49b31c044..5504c56cf 100644--- a/packages/errors/src/i18n/weblate/locales/ru.json+++ b/packages/errors/src/i18n/weblate/locales/ru.json@@ -17,6 +17,13 @@"account.limited": "Отправка сообщений в вашем аккаунте на паузе. Загляните в почту: чтобы продолжить, нужен всего один быстрый шаг.","account.mfa_email_verification_required": "Подтвердите эл. почту, чтобы использовать двухфакторную аутентификацию или ключи доступа.","account.password_required_to_claim": "{reason, select, email_delivery_off {Установите пароль, чтобы сохранить этот аккаунт. Этот экземпляр не может отправлять коды по эл. почте.} local_credential_basis {Установите пароль, чтобы сохранить этот аккаунт. Этот экземпляр требует пароль или ключ доступа для каждого аккаунта.} other {Установите пароль, чтобы сохранить этот аккаунт.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Этот фильтр контента 18+ недоступен для твоей возрастной группы.","account.session_timeout": "Время сессии истекло. Обнови страницу и войди снова.","account.session_token_mismatch": "Токен сессии не совпадает.",diff --git a/packages/errors/src/i18n/weblate/locales/sv-SE.json b/packages/errors/src/i18n/weblate/locales/sv-SE.jsonindex b0c06664c..8d71ad63e 100644--- a/packages/errors/src/i18n/weblate/locales/sv-SE.json+++ b/packages/errors/src/i18n/weblate/locales/sv-SE.json@@ -17,6 +17,13 @@"account.limited": "Meddelanden är pausade på ditt konto. Kolla din e-post så hittar du ett snabbt steg för att fortsätta.","account.mfa_email_verification_required": "Bekräfta din e-postadress för att använda tvåfaktorsautentisering eller lösennycklar.","account.password_required_to_claim": "{reason, select, email_delivery_off {Ange ett lösenord för att behålla det här kontot. Den här instansen kan inte skicka e-postkoder.} local_credential_basis {Ange ett lösenord för att behålla det här kontot. Den här instansen kräver ett lösenord eller en lösennyckel för alla konton.} other {Ange ett lösenord för att behålla det här kontot.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Det här filtret för känsligt innehåll är inte tillgängligt för din åldersgrupp.","account.session_timeout": "Sessionen har löpt ut. Uppdatera sidan och logga in igen.","account.session_token_mismatch": "Sessionstoken matchar inte.",diff --git a/packages/errors/src/i18n/weblate/locales/th.json b/packages/errors/src/i18n/weblate/locales/th.jsonindex ad7420e39..d6b461cc7 100644--- a/packages/errors/src/i18n/weblate/locales/th.json+++ b/packages/errors/src/i18n/weblate/locales/th.json@@ -17,6 +17,13 @@"account.limited": "ขณะนี้การส่งข้อความในบัญชีของคุณหยุดชั่วคราว โปรดดูอีเมลของคุณ แล้วทำขั้นตอนง่าย ๆ เพียงขั้นตอนเดียวเพื่อใช้งานต่อ","account.mfa_email_verification_required": "ยืนยันที่อยู่อีเมลของคุณเพื่อใช้การยืนยันตัวตนสองขั้นตอนหรือพาสคีย์","account.password_required_to_claim": "{reason, select, email_delivery_off {ตั้งรหัสผ่านเพื่อเก็บบัญชีนี้ไว้ อินสแตนซ์นี้ไม่สามารถส่งรหัสทางอีเมลได้} local_credential_basis {ตั้งรหัสผ่านเพื่อเก็บบัญชีนี้ไว้ อินสแตนซ์นี้กำหนดให้ทุกบัญชีต้องมีรหัสผ่านหรือพาสคีย์} other {ตั้งรหัสผ่านเพื่อเก็บบัญชีนี้ไว้}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "ตัวกรองเนื้อหาที่ละเอียดอ่อนนี้ไม่พร้อมใช้งานสำหรับกลุ่มอายุของคุณ","account.session_timeout": "เซสชันหมดเวลา โปรดรีเฟรชหน้าและเข้าสู่ระบบอีกครั้ง","account.session_token_mismatch": "โทเค็นเซสชันไม่ตรงกัน",diff --git a/packages/errors/src/i18n/weblate/locales/tr.json b/packages/errors/src/i18n/weblate/locales/tr.jsonindex d027978d4..ac69f9f15 100644--- a/packages/errors/src/i18n/weblate/locales/tr.json+++ b/packages/errors/src/i18n/weblate/locales/tr.json@@ -17,6 +17,13 @@"account.limited": "Hesabınızda mesajlaşma şimdilik duraklatıldı. Devam etmek için e-postanıza göz atın, sizi tek bir kısa adım bekliyor.","account.mfa_email_verification_required": "İki faktörlü kimlik doğrulama veya geçiş anahtarlarını kullanmak için e-posta adresinizi onaylayın.","account.password_required_to_claim": "{reason, select, email_delivery_off {Bu hesabı kaybetmemek için bir şifre belirleyin. Bu kurulum e-posta kodu gönderemiyor.} local_credential_basis {Bu hesabı kaybetmemek için bir şifre belirleyin. Bu kurulum her hesaptan bir şifre veya geçiş anahtarı istiyor.} other {Bu hesabı kaybetmemek için bir şifre belirleyin.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Bu hassas içerik filtresi yaş grubun için kullanılamıyor.","account.session_timeout": "Oturum zaman aşımına uğradı. Sayfayı yenile ve tekrar giriş yap.","account.session_token_mismatch": "Oturum belirteci uyuşmuyor.",diff --git a/packages/errors/src/i18n/weblate/locales/uk.json b/packages/errors/src/i18n/weblate/locales/uk.jsonindex 8e97e809b..5a6c24da3 100644--- a/packages/errors/src/i18n/weblate/locales/uk.json+++ b/packages/errors/src/i18n/weblate/locales/uk.json@@ -17,6 +17,13 @@"account.limited": "Надсилання повідомлень у вашому обліковому записі на паузі. Загляньте в електронну пошту: щоб продовжити, потрібен лише один швидкий крок.","account.mfa_email_verification_required": "Підтвердьте електронну пошту, щоб використовувати двофакторну автентифікацію або ключі доступу.","account.password_required_to_claim": "{reason, select, email_delivery_off {Встановіть пароль, щоб зберегти цей обліковий запис. Цей екземпляр не може надсилати коди електронною поштою.} local_credential_basis {Встановіть пароль, щоб зберегти цей обліковий запис. Цей екземпляр вимагає пароль або ключ доступу для кожного облікового запису.} other {Встановіть пароль, щоб зберегти цей обліковий запис.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Цей фільтр чутливого вмісту недоступний для твоєї вікової групи.","account.session_timeout": "Час сесії вичерпано. Онови сторінку та увійди знову.","account.session_token_mismatch": "Токен сесії не збігається.",diff --git a/packages/errors/src/i18n/weblate/locales/vi.json b/packages/errors/src/i18n/weblate/locales/vi.jsonindex 84d4230bd..4a4c15530 100644--- a/packages/errors/src/i18n/weblate/locales/vi.json+++ b/packages/errors/src/i18n/weblate/locales/vi.json@@ -17,6 +17,13 @@"account.limited": "Tính năng nhắn tin trên tài khoản của bạn đang tạm dừng. Hãy kiểm tra email và làm một bước đơn giản để tiếp tục.","account.mfa_email_verification_required": "Xác nhận địa chỉ email của bạn để sử dụng xác thực hai yếu tố hoặc khóa truy cập.","account.password_required_to_claim": "{reason, select, email_delivery_off {Đặt mật khẩu để giữ tài khoản này. Máy chủ này không thể gửi mã qua email.} local_credential_basis {Đặt mật khẩu để giữ tài khoản này. Máy chủ này yêu cầu mọi tài khoản phải có mật khẩu hoặc khóa truy cập.} other {Đặt mật khẩu để giữ tài khoản này.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "Bộ lọc nội dung nhạy cảm này không khả dụng cho độ tuổi của bạn.","account.session_timeout": "Phiên đã hết hạn. Hãy làm mới trang và đăng nhập lại.","account.session_token_mismatch": "Token phiên không khớp.",diff --git a/packages/errors/src/i18n/weblate/locales/zh-CN.json b/packages/errors/src/i18n/weblate/locales/zh-CN.jsonindex f7255ee87..2d1561655 100644--- a/packages/errors/src/i18n/weblate/locales/zh-CN.json+++ b/packages/errors/src/i18n/weblate/locales/zh-CN.json@@ -17,6 +17,13 @@"account.limited": "你账号的消息功能已暂停。请查看邮箱,完成一个简单步骤即可继续使用。","account.mfa_email_verification_required": "请确认你的邮箱地址,以便使用双重认证或通行密钥。","account.password_required_to_claim": "{reason, select, email_delivery_off {请设置密码以保留此账号。此实例无法发送邮件验证码。} local_credential_basis {请设置密码以保留此账号。此实例要求每个账号都设置密码或通行密钥。} other {请设置密码以保留此账号。}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "此敏感内容过滤器不适用于你的年龄段。","account.session_timeout": "会话超时。刷新页面后重新登录。","account.session_token_mismatch": "会话令牌不匹配。",diff --git a/packages/errors/src/i18n/weblate/locales/zh-TW.json b/packages/errors/src/i18n/weblate/locales/zh-TW.jsonindex b70db2158..abbe9b725 100644--- a/packages/errors/src/i18n/weblate/locales/zh-TW.json+++ b/packages/errors/src/i18n/weblate/locales/zh-TW.json@@ -17,6 +17,13 @@"account.limited": "您帳號的訊息功能已暫停。請查看電子郵件,完成一個簡單步驟即可繼續使用。","account.mfa_email_verification_required": "請確認你的電子郵件地址,以便使用雙重驗證或通行金鑰。","account.password_required_to_claim": "{reason, select, email_delivery_off {請設定密碼以保留此帳號。此實例無法傳送電子郵件驗證碼。} local_credential_basis {請設定密碼以保留此帳號。此實例要求每個帳號都設定密碼或通行金鑰。} other {請設定密碼以保留此帳號。}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "這個敏感內容篩選器不適用於你的年齡層。","account.session_timeout": "工作階段逾時。請重新整理頁面並重新登入。","account.session_token_mismatch": "工作階段權杖不符。",diff --git a/packages/errors/src/i18n/weblate/messages.json b/packages/errors/src/i18n/weblate/messages.jsonindex 05a33d550..cef080c5a 100644--- a/packages/errors/src/i18n/weblate/messages.json+++ b/packages/errors/src/i18n/weblate/messages.json@@ -17,6 +17,13 @@"account.limited": "Messaging is paused on your account. Check your email for a quick step to continue.","account.mfa_email_verification_required": "Confirm your email address to use two-factor authentication or passkeys.","account.password_required_to_claim": "{reason, select, email_delivery_off {Set a password to keep this account. This instance can't send email codes.} local_credential_basis {Set a password to keep this account. This instance asks every account for a password or passkey.} other {Set a password to keep this account.}}",+ "account.play_integrity_app_not_recognized": "Install the app from Google Play and sign in to Google Play to check your age in the app.",+ "account.play_integrity_challenge_invalid": "This check has expired or was already used. Try again.",+ "account.play_integrity_device_not_trusted": "This device didn't pass the Google Play device check, so the app can't check your age on it.",+ "account.play_integrity_not_available": "Age checks from the Android app aren't available on this instance.",+ "account.play_integrity_request_invalid": "This age check request isn't valid.",+ "account.play_integrity_token_invalid": "We couldn't confirm this age check from your device. Try again.",+ "account.play_integrity_unavailable": "We couldn't connect to Google Play to check your age. Try again later.","account.sensitive_content_filter_age_restricted": "This sensitive content filter isn't available for your age group.","account.session_timeout": "Session timed out. Refresh the page and log in again.","account.session_token_mismatch": "Session token mismatch.",diff --git a/packages/schema/src/domains/user/AgeAssuranceSchemas.ts b/packages/schema/src/domains/user/AgeAssuranceSchemas.tsindex ea6cd3d86..64657b2da 100644--- a/packages/schema/src/domains/user/AgeAssuranceSchemas.ts+++ b/packages/schema/src/domains/user/AgeAssuranceSchemas.ts@@ -8,6 +8,9 @@ import {APP_ATTEST_KEY_ID_BYTES,AppAttestChallengePurposes,AttestedAgeFloors,+ PLAY_INTEGRITY_CLIENT_DATA_MAX_BYTES,+ PLAY_INTEGRITY_PACKAGE_NAME_MAX_LENGTH,+ PLAY_INTEGRITY_TOKEN_MAX_LENGTH,} from '@fluxer/constants/src/AgeAssuranceConstants';import {ValidationErrorCodes} from '@fluxer/constants/src/ValidationErrorCodes';import {withBase64Binary} from '@fluxer/schema/src/primitives/Base64BinaryFields';@@ -16,6 +19,8 @@ import {createNamedStringLiteralUnion} from '@fluxer/schema/src/primitives/Schemimport {z} from 'zod';const BASE64URL_REGEX = /^[A-Za-z0-9_-]+$/;+const ANDROID_PACKAGE_NAME_REGEX = /^[A-Za-z][A-Za-z0-9_]*(\.[A-Za-z][A-Za-z0-9_]*)+$/;+const PLAY_INTEGRITY_TOKEN_REGEX = /^[\x21\x23-\x5b\x5d-\x7e]+$/;function decodedBase64Length(value: string): number {const padding = value.length - value.replace(/=+$/, '').length;@@ -127,3 +132,24 @@ export const AgeAssuranceSubmitResponse = z.object({});export type AgeAssuranceSubmitResponse = z.infer<typeof AgeAssuranceSubmitResponse>;++export const PlayIntegrityAgeSubmitRequest = z.object({+ package_name: z+ .string()+ .max(PLAY_INTEGRITY_PACKAGE_NAME_MAX_LENGTH)+ .regex(ANDROID_PACKAGE_NAME_REGEX)+ .describe('Package name of the Android app that asked for the integrity token, such as com.fluxer'),+ integrity_token: z+ .string()+ .min(1)+ .max(PLAY_INTEGRITY_TOKEN_MAX_LENGTH)+ .regex(PLAY_INTEGRITY_TOKEN_REGEX)+ .describe(+ 'Token from a standard Play Integrity request, made with requestHash set to the SHA-256 of client_data as unpadded base64url',+ ),+ client_data: base64BytesType(1, PLAY_INTEGRITY_CLIENT_DATA_MAX_BYTES).describe(+ 'The exact UTF-8 JSON bytes the app hashed, as standard base64 on one line with no line breaks (Base64.NO_WRAP on Android). The JSON holds challenge, age_lower, age_upper and age_range_source',+ ),+});++export type PlayIntegrityAgeSubmitRequest = z.infer<typeof PlayIntegrityAgeSubmitRequest>;