Commit Graph

9 Commits

Author SHA1 Message Date
ParthSareen
f4e5978e4f auth: add tests for sign-in state functions
Add comprehensive test coverage for local sign-in state storage:

signin_state_test.go:
- Basic set/get/clear operations
- File not found and invalid JSON handling
- Atomic write verification
- File permissions check
- Round-trip test

signin_flow_test.go:
- WhoamiHandler flow simulation
- Offline scenarios (with/without cache)
- Session overwrite behavior
- Edge cases: empty name, unicode, special chars, long values
- Concurrent read/write access
- Filesystem edge cases (read-only directory)
2026-01-07 15:41:36 -08:00
ParthSareen
eed58a312d auth: add local sign-in state storage
Add functions to cache sign-in state locally at ~/.ollama/signin.json,
enabling offline sign-in status checks without network calls.

- SignInState struct with Name, Email, and CachedAt fields
- GetSignInState() reads cached state from disk
- SetSignInState() atomically writes state (temp file + rename)
- ClearSignInState() removes the cached state file
- IsSignedIn() quick check for valid cached sign-in
2026-01-07 15:35:48 -08:00
Patrick Devine
64883e3c4c auth: fix problems with the ollama keypairs (#12373)
* auth: fix problems with the ollama keypairs

This change adds several fixes including:
  - reading in the pubkey files correctly
  - fixing the push unit test to create a keypair file in a temp directory
  - not return 500 errors for normal status error
2025-09-22 23:20:20 -07:00
Patrick Devine
eb0a5d4459 auth: check the permissions on the private key to see if it's readable (#12336) 2025-09-18 14:34:34 -07:00
Patrick Devine
8b894933a7 engine: add remote proxy (#12307) 2025-09-17 14:40:53 -07:00
Michael Yang
b732beba6a lint 2024-08-01 17:06:06 -07:00
Bruce MacDonald
0a7fdbe533 prompt to display and add local ollama keys to account (#3717)
- return descriptive error messages when unauthorized to create blob or push a model
- display the local public key associated with the request that was denied
2024-04-30 11:02:08 -07:00
Michael Yang
e43648afe5 rerefactor 2024-02-15 05:56:45 +00:00
Daniel Hiltgen
f397e0e988 Move hub auth out to new package 2024-02-15 05:56:45 +00:00