Skip to content

feat: Go SDK update for version v5.1.0#62

Merged
abnegate merged 2 commits into
mainfrom
dev
Jun 5, 2026
Merged

feat: Go SDK update for version v5.1.0#62
abnegate merged 2 commits into
mainfrom
dev

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

This PR contains updates to the Go SDK for version v5.1.0.

What's Changed

  • Added: createSesProvider and updateSesProvider to messaging
  • Added: updateOAuth2Server to project for OAuth2 server settings
  • Added: updatePasswordStrengthPolicy and PolicyPasswordStrength to project
  • Added: getAuditsDB health check to health
  • Added: password-strength to ProjectPolicyId
  • Added: apps.read and apps.write to ProjectKeyScopes

@greptile-apps

greptile-apps Bot commented Jun 5, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates the Go SDK to v5.1.0, adding new endpoints (CreateSesProvider, UpdateSesProvider, UpdateOAuth2Server, UpdatePasswordStrengthPolicy, GetAuditsDB) and a new PolicyPasswordStrength model. It also introduces a structural change where WithProject now stores the project ID in a Config map instead of directly in the global Headers map, with each service method reading Config["project"] to set the X-Appwrite-Project header per-request.

  • Header refactor: client.Config map introduced; WithProject and other With* option setters now write to Config alongside Headers. All 81 changed service files have been consistently updated to include "X-Appwrite-Project": srv.client.Config["project"] in every request headers block.
  • New endpoints: CreateSesProvider/UpdateSesProvider in messaging, UpdateOAuth2Server and UpdatePasswordStrengthPolicy in project, and GetAuditsDB in health — all following existing SDK patterns.
  • Model updates: models/project.go adds eight new OAuth2 server fields and moves Region earlier in the struct; new models/policyPasswordStrength.go covers the password-strength policy response.

Confidence Score: 4/5

Safe to merge after fixing the []interface{}{} type in the OAuth2 server docs example; all runtime code is correct and consistent.

The header-per-request refactor is applied uniformly across all service files — every method that makes an HTTP call now explicitly carries X-Appwrite-Project. New endpoints and the new model are correctly implemented. The one concrete error is in the generated docs example for UpdateOAuth2Server, which passes []interface{}{} where []string is required, meaning anyone who copies that snippet will get a compile failure.

docs/examples/project/update-o-auth-2-server.md — type mismatch on the Scopes argument that must be corrected.

Important Files Changed

Filename Overview
client/client.go Adds Config map[string]string field to the Client struct and bumps SDK version to v5.1.0. The Config map stores per-request values like project that individual service methods now read to set the X-Appwrite-Project header.
appwrite/appwrite.go Changes WithProject to store value in Config["project"] instead of Headers["X-Appwrite-Project"]. Other With* setters mirror the same pattern, also storing values in Config. This is a structural refactor that requires all service methods to explicitly read from Config per-request.
project/project.go Adds UpdateOAuth2Server and UpdatePasswordStrengthPolicy methods plus backfills X-Appwrite-Project header in all existing methods. New methods follow established patterns correctly.
messaging/messaging.go Adds CreateSesProvider and UpdateSesProvider methods and backfills X-Appwrite-Project header across all existing provider/topic/subscriber methods. Implementation follows existing patterns correctly.
health/health.go Adds GetAuditsDB method and backfills X-Appwrite-Project header in all existing health-check methods.
models/policyPasswordStrength.go New model for password strength policy with fields Id, Min, Uppercase, Lowercase, Number, Symbols. Follows the existing model pattern with New() and Decode() methods.
models/project.go Moves Region field earlier in the struct, relocates BillingLimits, and adds eight new OAuth2 server fields. JSON tags are correct.
docs/examples/project/update-o-auth-2-server.md Contains a type mismatch: Scopes is passed as []interface{}{} but the method takes []string. This example would not compile.
docs/examples/messaging/create-ses-provider.md New example for CreateSesProvider. Follows same documentation pattern as other provider examples.
docs/examples/health/get-audits-db.md New documentation example for the GetAuditsDB health check endpoint.

Reviews (1): Last reviewed commit: "chore: update Go SDK to v5.1.0" | Re-trigger Greptile

response, error := service.UpdateOAuth2Server(
false,
"https://example.com",
project.WithUpdateOAuth2ServerScopes([]interface{}{}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 The Scopes option takes []string in the actual method signature (func (srv *Project) WithUpdateOAuth2ServerScopes(v []string)), but the example passes []interface{}{}. Copying this example would result in a compile error.

Suggested change
project.WithUpdateOAuth2ServerScopes([]interface{}{}),
project.WithUpdateOAuth2ServerScopes([]string{}),

@abnegate abnegate merged commit c59e371 into main Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants