Repository navigation
Description
Problem
On the Mac, a MySQL, MariaDB or PostgreSQL connection can sign in with a short-lived token instead of a password: AWS IAM for Amazon RDS and Aurora (connections/aws-iam.mdx) and Google Cloud IAM for Cloud SQL (connections/cloud-sql-proxy.mdx, IAM sign-in without the proxy). The choice is stored in the connection's awsAuth field (apple/TablePro/Models/Connection/DatabaseConnection+IAMSignIn.swift:36), with the values accessKey, profile, sso, gcpApplicationDefault and gcpServiceAccount (apple/Plugins/TableProPluginKit/AWS/AWSAuthFields.swift:11, apple/Plugins/TableProPluginKit/GoogleCloud/GoogleCloudSQLAuthFields.swift:6).
These connections sync to the iPhone and iPad, but the iOS app never reads awsAuth: nothing under apple/TableProMobile refers to it. It signs in with the saved password, which an IAM database user does not have, so the server refuses the login and the error says nothing about IAM. ios/index.mdx does not mention IAM at all.
The token code is in the Mac app target (apple/TablePro/Core/Database/AWS/RDSAuthTokenGenerator.swift), so the iOS app cannot call it today. Two of the Mac's methods also depend on files the phone does not have: AWS IAM (Profile) reads ~/.aws/config and ~/.aws/credentials, and Google Cloud IAM (Application Default) reads the gcloud credentials.
Proposed solution
- Read
awsAuthon iOS for MySQL, MariaDB and PostgreSQL, and sign a fresh token on every connect, never stored, with TLS raised to Required as on the Mac. - AWS IAM (Access Key): sign with an access key kept in the device Keychain, entered on the device or brought over with Sync Passwords.
- AWS IAM (SSO): sign in to IAM Identity Center from the device with the device authorization flow, the way Microsoft Entra ID sign-in works on iOS today (
apple/TableProMobile/TableProMobile/SignIn/EntraSignIn.swift). - Google Cloud IAM (Service Account): sign with a service account key pasted on the device and kept in the Keychain.
- AWS IAM (Profile) and Google Cloud IAM (Application Default): say on the connection screen that this method needs files on the Mac, and offer to set an access key or service account key for this device only, without changing the synced connection.
- Move the RDS token signer into a package both apps link, so they sign the same way.
- Until the sign-in works, a synced IAM connection says it uses IAM instead of failing on a password.
Done means: an RDS PostgreSQL connection set to AWS IAM (Access Key) on the Mac opens on the iPhone once the key is on the device, and a Profile connection explains what the phone needs.
Alternatives considered
Run aws rds generate-db-auth-token on a computer and paste the token as the password on the phone. It expires after 15 minutes.
Platform
iOS
Related database type
N/A / General
Activity