Fix: Require handlePrefix for org creation and improve SDS demo #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes several improvements to the SDS organization creation flow and the SDS demo application.
Main Fix: Require handlePrefix for org creation
Problem
Previously, the SDS server was auto-generating organization handles by appending a timestamp to the organization name (e.g.,
name-1234567890). This approach had several critical issues:Solution
This PR changes the API to require a
handlePrefixparameter from the client, and the SDS server appends its hostname as the suffix to form a valid FQDN handle. This ensures:Changes
API Changes
com.sds.organization.createto requirehandlePrefixinstead of optionalhandle@atproto/syntaxand checks for uniqueness before creatinghostname(nothost) to exclude port numbers from handlesFrontend Changes
Validation
@atproto/syntaxto validate handle format in real-timecom.atproto.identity.resolveHandleAdditional Fixes
OAuth Scope Improvements
include:com.atproto.moderation.basePermissionswhen using local dev PDS (where the lexicon is registered), preventinginvalid_scopeerrors with external PDS instancesidentity:*,account:status,blob:*/*,rpc:*?aud=did:web:bsky.app#bsky_appview) to follow principle of least privilege and avoid scary "could steal your account" warningsOther Improvements
.envfilesTesting
handlePrefixparameterMigration Notes
This is a breaking change for the
com.sds.organization.createAPI:handleparameter has been removedhandlePrefixparameter is now requiredhandlePrefixinstead ofhandleCommits Included
fix(sds): require handlePrefix for org creation instead of auto-generatingfeat(sds-demo): support dotenv loading of variablesfix(sds-demo): gracefully handle accounts without profilesfix(sds-demo): reduce OAuth scopes to minimum required permissionsfix(sds-demo): conditionally include moderation scope for local dev PDSchore(oauth-provider-ui): remove unnecessary console logging