Хранилище секретов принимает недоступный файл за отсутствующий

Open Beginner friendly
#417 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Read src/Bydlo.Platform/SecretStores.cs at FileSecretStoreBase.LoadAsync (lines 31–47) and trace how secret file reads handle missing files and access errors. Add or locate tests for FileSecretStoreBase that distinguish a missing secret from an inaccessible one; done when missing files return ProfileSecrets.Empty and access failures raise SecretAccessException.

Written by the indexing model from the issue text.

Description

bug P1

#375 добавил SecretAccessException при ошибках чтения, но FileSecretStoreBase.LoadAsync по-прежнему начинает с File.Exists. Этот API возвращает false также при ошибках доступа к пути, поэтому выполнение может вернуть ProfileSecrets.Empty до попытки чтения.

Сценарий: сохранён профиль HTTP с паролем, а каталог хранилища временно недоступен для процесса. File.Exists возвращает false. BackupArchive.HasRequiredSecrets допускает пустой набор для HTTP, и экспорт может завершиться архивом без существующих учётных данных. Восстановление также может принять пустой набор за достоверный снимок для отката.

Ожидается прямое чтение файла с возвратом Empty только при подтверждённом отсутствии (FileNotFoundException/DirectoryNotFoundException), а прочие ошибки доступа должны давать SecretAccessException. Добавить проверку различия между отсутствующим и недоступным секретом.

Код: https://github.com/endercodezz/BYDLO/blob/3363f21/src/Bydlo.Platform/SecretStores.cs#L31-L47

Dominant language
C#
Stars
5
Forks
1
Avg merge
46m
Merged PRs (30d)
179

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from endercodezz/BYDLO

All issues in endercodezz/BYDLO

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.