Skip to content

feat(credentials): add Azure OpenAI credential type to the project dashboard - #14

Open
Rahulkaushik01 wants to merge 1 commit into
devfrom
feat/azure-openai-credential
Open

feat(credentials): add Azure OpenAI credential type to the project dashboard#14
Rahulkaushik01 wants to merge 1 commit into
devfrom
feat/azure-openai-credential

Conversation

@Rahulkaushik01

Copy link
Copy Markdown
Collaborator

What & why

Adds a per-project Azure OpenAI credential to the project dashboard, alongside the
existing STT providers. This is the storage foundation for upcoming meeting title +
summary
generation — a separate concern from the transcription OpenAI credential
(chat/completions needs endpoint + deployment + api-version, which a plain key can't hold).

Scope: dashboard + encrypted storage only. No consumer is wired yet (the summarization
task lands in a later phase), so this changes no runtime behaviour — a project without an
Azure credential is simply unaffected.

How it works

  • Fields captured: endpoint, deployment, api_key, api_version (optional → defaults to
    the DEFAULT_AZURE_OPENAI_API_VERSION constant).
  • Save/edit: get_or_create(project, type) + set_credentials(dict) — Fernet-encrypted at
    rest, exactly like every other provider (verified: the stored blob is ciphertext, no plaintext).
  • Fetch (for the future task): …credentials.filter(credential_type=AZURE_OPENAI).first().get_credentials().
  • Delete: handled by the generic DeleteCredentialsView (no type-specific code).
  • Mirrors the External Media Storage (multi-field) + ElevenLabs (masked key) partials; non-secret
    fields are pre-filled on edit so editing never silently drops them.

Per-file changes

  • bots/models.py — add AZURE_OPENAI = 12 credential type + DEFAULT_AZURE_OPENAI_API_VERSION constant.
  • bots/projects_views.py — Azure branch in get_partial_for_credential_type; save branch in
    CreateCredentialsView.post (require endpoint+deployment+api_key → 400, default api_version);
    Azure query + two context keys in ProjectCredentialsView; import the constant.
  • bots/templates/projects/partials/azure_openai_credentials.html (new) — Add/Edit card + modal
    (masked key display, htmx save).
  • bots/templates/projects/project_credentials.html — include the Azure card.
  • bots/migrations/0095_alter_credentials_credential_type.py (new) — additive AlterField for the
    new choice (no data change).
  • bots/tests/test_azure_openai_credentials.py (new) — 9 tests.

Testing

  • python manage.py makemigrations --checkNo changes detected (migration matches the model).
  • python manage.py test bots.tests.test_azure_openai_credentials9 passed; existing
    test_delete_credentials8 passed (no regression).
  • ruff check / ruff format --check → clean.
  • Manual/browser E2E: Add → card shows masked key + defaulted api-version → stored dict verified →
    delete. Encryption-at-rest confirmed.

Notes

  • No new dependencies.
  • Secret only ever lives in the encrypted Credentials row — never in code, env, or a bundle.

…shboard

Adds a per-project Azure OpenAI credential (endpoint, deployment, api_key,
api_version), mirroring the existing STT credential types. Stored encrypted in
the existing Credentials model and read back via get_credentials(); this is the
storage foundation for upcoming meeting title/summary generation. Dashboard +
storage only — no consumer wired yet.

- bots/models.py: add AZURE_OPENAI credential type + DEFAULT_AZURE_OPENAI_API_VERSION constant
- bots/projects_views.py: create/save branch (endpoint+deployment+api_key required,
  api_version defaults to the constant), partial dispatch, and credentials-page context
- bots/templates/projects/partials/azure_openai_credentials.html: Add/Edit card + modal
  (masked API key, non-secret fields prefilled on edit)
- bots/templates/projects/project_credentials.html: include the Azure OpenAI card
- bots/migrations/0095_alter_credentials_credential_type.py: additive choice migration
- bots/tests/test_azure_openai_credentials.py: create/default/validation/edit/delete/
  page-render/encryption round-trip tests
@Rahulkaushik01
Rahulkaushik01 requested a review from hd1801 August 7, 2026 12:53
@Rahulkaushik01 Rahulkaushik01 self-assigned this Aug 7, 2026
@Rahulkaushik01 Rahulkaushik01 added the enhancement New feature or request label Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant