1556 Commits

Author SHA1 Message Date
Matheus Pimenta 0e5a339f11 feat(jwt-asm): support AWS Secrets Manager for JWT verification (#3763)
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-02-03 09:25:38 -08:00
Andrei Aaron 7f629b5d67 feat(zui): add Last Tagged timestamp to tag details view (#3772)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-02-03 10:22:57 +02:00
Matheus Pimenta b9aad15ad0 feat(jwt-exp): exp claim at the access entry level (#3761)
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-02-02 00:26:36 +02:00
Andrei Aaron 063014a942 ci: improvements for the Ecosystem tools job (#3762)
ci: blackbox test impromentts

A mutated zli config could be the cause of https://github.com/project-zot/zot/actions/runs/21560982825/job/62141227950

1. show zli configuration after cve.basts finishes running
2. ensure the zli config is removed in between test files
3. ensure teh zli configs use different names, not "main"

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-02-01 23:58:18 +02:00
Matheus Pimenta c8fae88e37 feat(oidc): support per-issuer CA (#3760)
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
2026-02-01 23:57:27 +02:00
Ramkumar Chinchani b905528b6c chore: fix dependabot alerts (#3751)
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2026-01-31 11:48:29 +02:00
Andrei Aaron 3c7d5a5f1d feat: add TaggedTimestamp to ImageSummary returned by graphql API (#3731)
feat(meta): add TaggedTimestamp field and preserve during re-parsing

Add TaggedTimestamp field to track when image tags were created, exposed
through GraphQL API. Previously, when zot restarted and re-parsed storage,
ResetRepoReferences would clear all tags, causing timestamp information to
be lost and reset to the service restart time for existing images.

This change adds TaggedTimestamp support and modifies ResetRepoReferences to
selectively preserve tags that still exist in storage, maintaining their
TaggedTimestamp values. Tags that no longer exist in storage are removed as
before.

Changes:
- Add TaggedTimestamp field to GraphQL ImageSummary schema
- Update GraphQL conversion functions to populate TaggedTimestamp with
  fallback to PushTimestamp when unavailable
- Updated ResetRepoReferences interface to accept tagsToKeep parameter
- Modified ParseRepo to collect tags from storage before resetting
- Updated all backend implementations (Redis, DynamoDB, BoltDB) to preserve
  tags in tagsToKeep instead of clearing all tags
- Updated tests and mocks to match new signature

This ensures TaggedTimestamp accurately reflects when tags were originally
created, and exposes this information through the GraphQL API.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-01-30 23:05:14 +02:00
Andrei Aaron e82aac8409 fix(fips): flaky fips blackbox test and add missing curves (#3732)
2 unrelated issues:
See https://github.com/project-zot/zot/actions/runs/21336958408/job/61410298444?pr=3731 for details.
Also add missing fips curves https://cs.opensource.google/go/go/+/refs/tags/go1.25.6:src/crypto/tls/defaults_fips140.go;l=33

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-01-26 13:45:03 +02:00
Matheus Pimenta bf619c570e Introduce support for OIDC workload identity federation (#3711)
* feat(oidc): introduce support for OIDC workload identity federation

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>

* feat(oidc): add e2e test for bearer OIDC and a kind cluster

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>

* feat(oidc): make OIDC workload identity federation its own feature

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>

* feat(oidc): move errors to the errors package

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>

* feat(oidc): fix race in cel package

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>

* feat(oidc): compile cel expressions

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>

---------

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
v2.1.14
2026-01-24 21:03:53 -08:00
Ramkumar Chinchani ba3436c57e ci: add a upgrade bats test (#3621)
* ci: add a upgrade bats test

Fixes https://github.com/project-zot/zot/issues/3601

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* ci: first check existing images

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* ci: refactor into common test code

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* refactor: Refactor upgrade tests to improve readability and maintainability

- Added section headers for release tests, upgrade process, and new tests in upgrade.bats and upgrade_minimal.bats.
- Replaced inline port retrieval with a function call to get_zot_port for consistency.
- Consolidated repeated test logic into dedicated functions (e.g., test_new_existing_pull_image, test_new_push_image).
- Removed unnecessary variable assignments and streamlined test cases for clarity.

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2026-01-24 13:42:45 -08:00
Ramkumar Chinchani 5f15470763 chore: fix dependabot alerts (#3730)
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2026-01-24 11:52:02 +02:00
Ramkumar Chinchani dd1987fd11 chore: fix dependabot alerts (#3726)
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2026-01-22 14:54:11 +02:00
Andrei Aaron 088914bb05 fix: graphql playground documentation was hardcoded to an unrelated example (#3721)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-01-21 09:28:49 +02:00
Andrei Aaron 14e537a5eb chore: remove direct usage of the github.com/aws/aws-sdk-go package (aws sdk v1) (#3701)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-01-15 21:43:34 +02:00
Ramkumar Chinchani 0cac8a7ee8 chore: fix dependabot alerts (#3707)
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2026-01-15 20:42:39 +02:00
Andrei Aaron d33c1e3b22 fix: now attempt to bind to the zot server socket to check if the server is running (#3703)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-01-15 20:02:15 +02:00
Andrei Aaron 7c9064574d fix: remove usage of deprecated function aws.EndpointResolverWithOptionsFunc (#3700)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-01-15 09:29:01 -08:00
Asgeir Storesund Nilsen 708adf63d4 fix: CVE-2025-30204 - golang-jwt DoS vulnerability via excessive memory allocation (#3687)
* fix: CVE-2025-30204 - golang-jwt DoS vulnerability via excessive memory
allocation

Signed-off-by: Asgeir Nilsen <asgeir@twingine.no>

* fix: linting

Signed-off-by: Asgeir Nilsen <asgeir@twingine.no>

* chore: update project-zot/mockoidc to remove golang-jwt v3

Signed-off-by: Asgeir Nilsen <asgeir@twingine.no>

* test: Add more tests for bearer tokens

Signed-off-by: Asgeir Nilsen <asgeir@twingine.no>

* fix: Rewrite tests to remove MakeAuthTestServerLegacy

Signed-off-by: Asgeir Nilsen <asgeir@twingine.no>

---------

Signed-off-by: Asgeir Nilsen <asgeir@twingine.no>
2026-01-14 11:34:58 +02:00
Andrei Aaron e2ba7c8e20 fix: pre-existing dynamodb versions table should be populated with version if it doesn't contain it already (#3699)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-01-13 13:11:40 +02:00
Ramkumar Chinchani bc9f270e96 ci: fix nightly due to outdated kind (#3676)
ci: update kind version

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2026-01-12 10:14:23 -08:00
Ricardo Noriega ac5fbd9110 Fix typos in documentation (#3678)
docs: Fix typos in documentation

Signed-off-by: Ricardo Noriega De Soto <rnoriega@redhat.com>
2026-01-12 11:00:30 +02:00
Ramkumar Chinchani 800a545fbe chore: fix dependabot alerts (#3677)
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2025-12-29 09:59:57 +02:00
Andrei Aaron 95b8d65c8a test: fix some coverage issues, refactored some of the pagination logic to accomplish this (#3674)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-12-23 19:06:13 +02:00
Andrei Aaron 4ad3fad3bc fix: do not reject requests having an Authorization header if basic auth is disabled (#3673)
See https://github.com/project-zot/zot/issues/3662

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
v2.1.13
2025-12-23 11:30:22 +02:00
Ramkumar Chinchani 331a927fa4 chore: fix dependabot alerts (#3660)
* chore: fix dependabot alerts

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix: linter error

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
v2.1.12
2025-12-19 12:12:10 -08:00
Andrei Aaron f39c5e058e fix: make sure the function and caller information are added to log messages emitted by 3rd party libraries using slog directly. (#3659) 2025-12-19 07:32:13 +02:00
Andrei Aaron 79439bbf63 feat: add configurable mTLS identity extraction with fallback chain (#3640)
Add support for configurable identity attributes in mTLS authentication,
allowing identity extraction from CommonName, Subject DN, Email SAN,
URI SAN, or DNSName SAN with fallback chain support. Includes regex
pattern matching for URI SANs (e.g., SPIFFE workload IDs).

- Add MTLSConfig with identity attributes, URISANPattern, and index fields
- Implement extractMTLSIdentity with fallback chain logic
- Move the mtls tests in the api package to pkg/api/mtls_test.go

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-12-18 09:10:47 -08:00
Gianluca Boiano f2064c9af0 fix: prevent nil pointer dereference in RemoveImageFromRepoMeta (#3658)
* fix: prevent nil pointer dereference in RemoveImageFromRepoMeta

This commit fixes a critical bug where RemoveImageFromRepoMeta crashes with
a nil pointer dereference during retention policy execution and GC operations.

Root Cause:
The function was accessing blob metadata without checking if it exists first.
During GC/retention operations, the metadata database might have stale
references to blobs that no longer exist, causing runtime panics.

Changes:
- Added nil check for descriptorBlobInfo before accessing LastUpdated field
- Added nil check for blobInfo before dereferencing Size, Vendors, Platforms, and SubBlobs
- Made the function consistent with recalculateAggregateFields which already had these checks

Impact:
- Fixes crashes during retention policy execution
- Fixes crashes during GC manifest removal
- Fixes image deletion failures via API
- Eliminates need for dryRun: true workaround in retention config

The fix gracefully handles missing blob metadata by skipping those entries
instead of crashing.

Signed-off-by: Gianluca Boiano <morf3089@gmail.com>

* test: add comprehensive tests for RemoveImageFromRepoMeta nil checks

Add test coverage for the nil pointer dereference fixes in RemoveImageFromRepoMeta.
These tests ensure the function handles missing blob metadata gracefully during
GC and retention operations.

Test cases:
- Handle nil blob info for descriptor digest (line 280 check)
- Handle nil blob info in queue traversal (line 297 check)
- Verify correct behavior with valid blob info
- Handle empty tags edge case
- Skip tags with empty digest

Coverage: RemoveImageFromRepoMeta now has 100% test coverage

Signed-off-by: Gianluca Boiano <morf3089@gmail.com>

* test: fix RemoveImageFromRepoMeta tests to match actual usage

Address review feedback:
- Delete tag from repoMeta.Tags before calling RemoveImageFromRepoMeta
- Fix blob count expectations after tag removal
- Add assertion to verify tag was removed from metadata
- Update comments to clarify expected behavior

Signed-off-by: Gianluca Boiano <morf3089@gmail.com>

* test: add tag removal assertion to second test case

Add missing assertion to verify tag1 was removed from resultMeta.Tags
in the 'should handle nil blob info in queue traversal' test.

Signed-off-by: Gianluca Boiano <morf3089@gmail.com>

* refactor: improve nil blob handling documentation and test coverage

Address Copilot review feedback:
- Expand comment at line 278 to explain implications of skipping tags
  with missing blob info, clarifying that metadata inconsistency is
  acceptable in GC/cleanup scenarios
- Revise 'should handle nil blob info for descriptor digest' test to
  cover more realistic scenario: remove tag1 while tag2 has missing
  blob info, demonstrating graceful handling of data inconsistencies
  in remaining tags during removal operations

All tests pass with 49 total assertions.

Signed-off-by: Gianluca Boiano <morf3089@gmail.com>

* fix: prevent nil pointer in GetCandidates when statistics missing

Add defensive check in pkg/retention/candidate.go to handle cases where
a tag exists in repoMeta.Tags but has no corresponding entry in
repoMeta.Statistics. This prevents incorrect retention decisions based
on zero-value timestamps.

Changes:
- Check statistics existence before creating candidates
- Skip tags with missing statistics (retained by GetRetainedTagsFromMetaDB)
- Improve performance from O(n*m) to O(n) by using direct map lookup
- Add comprehensive test coverage for missing statistics scenarios

This addresses the concern raised in PR #3658 about metadata
inconsistencies due to non-transactional writes to blob store and metaDB.

Related: #3658
Signed-off-by: Gianluca Boiano <morf3089@gmail.com>

* test: achieve 100% coverage for RemoveImageFromRepoMeta nil checks

Enhance test coverage for RemoveImageFromRepoMeta to address codecov failures
by adding comprehensive test cases that exercise all code paths including nil
pointer checks and continue statements.

Changes:
- Enhanced 'nil blob info for descriptor digest' test to verify processing
  continues with other valid tags after skipping nil entries
- Enhanced 'nil blob info in queue traversal' test to handle mixed valid/nil
  sub-blobs and verify correct processing continuation
- Added 'multiple nil blobs in deeply nested structure' test to cover complex
  scenarios with multiple missing blobs at various nesting levels
- Enhanced 'skip tags with empty digest' test to verify processing continues
  with valid tags after skipping empty digest entries
- Added 'combined edge cases' test to verify all edge cases work together:
  empty digest, nil descriptor blob, and nil queue blob

Coverage Results:
- RemoveImageFromRepoMeta: 100.0% line coverage (was 87.50%)
- All 7 test scenarios pass with 75 total assertions
- All nil check code paths fully exercised
- All continue statement behaviors validated

Fixes codecov/patch failure on PR #3658 where 2 lines were missing coverage.

Signed-off-by: Gianluca Boiano <morf3089@gmail.com>

---------

Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
2025-12-17 11:44:51 +02:00
Ramkumar Chinchani 3a349dccec chore: fix dependabot alerts (#3657)
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2025-12-15 23:34:32 -08:00
Andrei Aaron ed40bfd689 fix: more logging for sync extension (#3656)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-12-16 00:03:24 +02:00
Andrei Aaron e069229744 docs: fix deadlink and typo (#3641)
Fix the issue initially reported in https://github.com/project-zot/zot/pull/2380

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-12-14 13:58:08 +02:00
Andrei Aaron cf8b0bdbf9 refactor: enhance TLS cert generation and refactor HTTP client architecture (#3638)
- Refactored HTTP client from global cache to struct-based approach (global state was shared between tests, including what certificates to use)
- Enhanced pkg/test/tls to support ECDSA and ED25519 key types
- Replaced static certificate files with dynamic generation in golang tests
- Fixed test cleanup issues and improved resource management

This eliminates dependency on external cert generation scripts and
improves test maintainability.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-12-13 09:47:32 +02:00
Andrei Aaron 1447bb24b4 fix: accept log levels supported by older zot versions, validate configured log level (#3639)
In zot config accept the same log levels as in https://github.com/rs/zerolog/blob/5391dd7c34c86c2a3b731cd3c3f1b252706e7925/globals.go#L37
This is to maintain backward compatibility with other zot version configurations.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-12-13 00:33:54 +02:00
Andrei Aaron 08fae9104d feat: support mTLS-only authn/authz with AccessControl and allow combining mTLS with other auth mechanisms (#3624)
* feat: support mTLS-only authn/authz with AccessControl and allow combining mTLS with other auth mechanisms

Signed-off-by: Ivan Arkhipov <me@endevir.ru>

* refactor: improve authentication logic and TLS certificate generation

- Fix mTLS authentication to use only leaf certificate instead of iterating
  through all certificates in the chain
- Reject Authorization headers when corresponding auth method is disabled,
  regardless of mTLS status (security improvement)
- Simplify authentication switch statement ordering and logic
- Move ErrUserDataNotFound error handling into sessionAuthn method
- Refactor TLS certificate generation to use Options pattern with
  CertificateOptions struct for better extensibility
- Consolidate duplicate certificate generation code into helper functions
  (generateCertificate, parseCA, initializeTemplate, applyOptions)
- Rename certificate generation functions for clarity:
  - GenerateCertWithCN -> GenerateClientCert
  - GenerateSelfSignedCertWithCN -> GenerateClientSelfSignedCert
- Add support for SAN settings including email addresses in certificates
- Update tests to reflect new authentication behavior and certificate API

This commit improves both the security posture (rejecting disabled auth
methods) and code maintainability (consolidated certificate generation).

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>

* fix: guard against multiple Authorization headers

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>

---------

Signed-off-by: Ivan Arkhipov <me@endevir.ru>
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
Co-authored-by: Ivan Arkhipov <me@endevir.ru>
2025-12-11 20:08:32 +02:00
Ramkumar Chinchani e7b73b6c2d chore: fix dependabot alerts (#3636)
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2025-12-09 10:49:45 +02:00
Andrei Aaron 4628080fa1 fix: remove misleading error messages on successful syncs (#3619)
See: https://github.com/project-zot/zot/issues/3560#issuecomment-3594856118
What happens is:
- syncRef skips the image ("skipping image because it's already synced")
- syncReferrers doesn't sync anything
- CommitAll is still called even though nothing was synced
- The temp directory exists but is empty (no index.json, no blobs)
- CommitAll fails because index.json is missing

Let's ensure we properly check for errors, and skip the log messages if some of the cases.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-12-09 08:11:28 +02:00
Andrei Aaron ba8ab49502 ci: save unified coverage as build artifact (#3626)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-12-06 21:58:37 +02:00
Andrei Aaron 667ecfa40e ci: split needsprivileges tests from devmode tests (#3625)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-12-06 20:36:32 +02:00
Andrei Aaron 9dfa7c3ae6 refactor(test): new apis for creating temporary files (#3605)
Replace MakeTempFile usage with MakeTempFilePath and MakeTempFileWithContent
helpers that automatically handle file lifecycle. This prevents resource
leaks by ensuring temporary files are properly closed.

Shoudld also make the tests easier to read.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-12-05 09:54:38 +02:00
Ramkumar Chinchani 92aee8ebce chore: Fix deps (#3620)
* chore: fix dependabot alerts

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* chore: update zui

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2025-12-04 11:43:24 +02:00
Andrei Aaron edaef52d50 fix(trivy): cleanup Trivy temporary directory (#3618)
This Trivy commit changed the way the cleanup is done for Trivy operations:
https://github.com/aquasecurity/trivy/commit/8f5b56005a4e8752976524750089dc9ea2c91e40

We need to start calling the APIs to create and cleanup the temp dir to ensure we don't leave around content in the /tmp folder

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-12-03 10:11:32 +02:00
Andrei Aaron 8226b25509 feat(config): validate storage root directories for path conflicts (#3602)
Add validation to reject configuration files where stores and substores
of the same storage type (local or S3) have root directories that are
nested within each other or identical. Stores of different types (local
vs S3) are allowed to share the same root directory since they use
different storage backends.

The validation:
- Checks all stores (default + substores) for path conflicts
- Only compares stores of the same storage type
- Reports clear error messages indicating which stores conflict and why

Add comprehensive tests covering:
- Same storage types with identical/nested paths (rejected)
- Different storage types with same/nested paths (allowed)
- Various combinations of default store and substores

Fixes issues where nested or identical root directories could cause
data corruption or routing conflicts.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-11-29 23:55:27 +02:00
Andrei Aaron e510ab6426 Fix error handling: return nil explicitly on successful completion (#3603)
fix: error handling: return nil explicitly on successful completion

Several functions in pkg/meta/redis/redis.go were returning 'err' at the
end of successful execution paths, which could lead to incorrect error
handling when 'err' was overwritten in loops or conditionals.

Changed the following functions to return nil explicitly when all
operations succeed:
- SearchRepos: return nil instead of err after successful loop
- SearchTags: return nil instead of err after successful loop
- GetRepoMeta: return nil instead of err after successful operations
- GetImageMeta: return nil instead of err after successful operations
- GetReferrersInfo: return nil instead of err after successful loop

This ensures that when functions complete successfully, they explicitly
return nil rather than relying on the last value of err, which may have
been overwritten during execution. This fixes TestRedisUnreachable which
was failing because SearchRepos was incorrectly returning nil error when
Redis was unreachable.

See failure in: https://github.com/project-zot/zot/actions/runs/19729927463/job/56528529923?pr=3599

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-11-28 11:49:17 +02:00
Andrei Aaron cc34a6f4ef fix(meta): handle cases when substores are nested (#3598)
fix(meta): handle cases where repositories when substores are nested

Note this is a case of bad configuration: having multiple stores
in the same tree structure. Guard against it in parse.go.

Fix getAllRepos to prevent duplicate repositories in metaDB when substore
directories are nested under the default store root directory.

The fix processes substores first, then the default store, using a
map-based deduplication approach to skip repositories that have already
been added. This ensures that when both the default store and substores
contain repositories with the same name (e.g., when a substore is nested
within the default store), only one instance is added to the repository
list.

Add test TestNoDuplicateReposWithSubstoresAndNestedRepoNames to verify
the deduplication logic works correctly with nested substores.

Also update the other tests to avoid these issues in the future
this is not a vali configuration.

This is not the intended use case for substores, and it may have caused:
https://github.com/project-zot/zot/actions/runs/19665302669/job/56320640980

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-11-27 20:11:52 +02:00
Andrei Aaron 69c3a0b99b feat: explicitly log if each authentication method is enabled (#3599)
feat: explicitly log if each autentication methods is enabled

When the server starts or when the config is reloaded.
See the discussion in: https://github.com/project-zot/zot/pull/3577#issuecomment-3568505810

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-11-27 11:30:14 +02:00
Andrei Aaron e068b8dc9f chore: Enable Go jsonv2 experiment and update the trivy dependency (v0.67.2) (#3572)
It requires the encoding/json/jsontext
package which is only available when the goexperiment.jsonv2 build
tag is enabled. This was causing build constraint errors during
tests and builds.

Changes:
- Add GOEXPERIMENT=jsonv2 to Makefile export and all go build/test
  commands that use env (since env creates a fresh environment)
- Add GOEXPERIMENT=jsonv2 to GitHub workflows that use direct go
  commands (workflows using make inherit it from Makefile)

Fix other dependabot alerts.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-11-27 09:58:37 +02:00
Ramkumar Chinchani 6452bec403 chore: fix dependabot alerts (#3595)
* chore: fix dependabot alerts

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* ci: bump up golang to 1.25.x

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix: linter errors

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix: stacker and docker build files to use golang 1.25

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2025-11-26 11:21:36 +02:00
Andrei Aaron 09de471774 fix(storage): enforce standard OCI blob path structure in GetNextDigestWithBlobPaths (#3594)
Require blob files to follow standard OCI image layout:
rootDir/repo/blobs/algorithm/digest

- Validate grandparent directory is ImageBlobsDir
- Validate parent directory is valid digest algorithm
- Update tests to use standard OCI structure
- Add blobPath() helper to reduce duplication and fix linting

This should reduce the number of uneeded digest computations
if other non-oci specific files are present in the layout.

Fix also a race condition when picking ports in monitoring tests.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-11-25 11:50:48 +02:00
Ramkumar Chinchani 05e9b8cdf8 chore: sync golang 1.25 (#3596)
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2025-11-25 09:29:01 +02:00
Andrei Aaron a296968c1a fix: multiple fixes based on recent test failures (#3582)
* fix(monitoring): fix race condition in TestPopulateStorageMetrics

Write images to filesystem before starting controller to prevent GC
from reading index.json while it's being written.

See failure:
https://github.com/project-zot/zot/actions/runs/19633819097/job/56219606041

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>

* fix(sync): fix TestSignatures assertion on referrers order

Search through all referrers to find the expected OCI ref digest instead
of assuming it's at index.Manifests[1], as the order is not guaranteed.

See https://github.com/project-zot/zot/actions/runs/19630382617/job/56208492397?pr=3579

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>

* fix(redis): fix error handling in GetMultipleRepoMeta

The function was returning err at the end, which could be nil even when
HGetAll should have failed, because err gets reassigned in the loop.
Changed to return nil on success path, ensuring HGetAll errors are
properly propagated. Fixes TestRedisUnreachable failure.

See https://github.com/project-zot/zot/actions/runs/19634990856/job/56223414955?pr=3582

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>

* refactor(sync): simplify sync test structure and restore file permissions

Remove unnecessary nested Convey blocks and integrate error tests into
parent blocks. Add defer statements to restore file permissions after
chmod operations to prevent side effects on subsequent tests.

Fix potential root cause of https://github.com/project-zot/zot/actions/runs/19636284485/job/56227682319?pr=3579

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>

---------

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-11-24 19:23:52 +02:00