blob: 44cdbfe6175db1f9e2dc4498899c903413c8bdac [file] [edit]
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef THIRD_PARTY_CREDENTIO_TESTING_NONPROD_GENERATOR_H_
#define THIRD_PARTY_CREDENTIO_TESTING_NONPROD_GENERATOR_H_
#include <memory>
#include <optional>
#include "absl/status/statusor.h"
#include "absl/time/clock_interface.h"
#include "generator/generator.h"
#include "proto/generator_info.pb.h"
#include "uuid/uuid.h"
namespace credentio {
struct NonProdManifestStoreGeneratorOptions {
// If omitted, fake claim generator info will be used.
std::optional<GeneratorInfo> generator_info = std::nullopt;
// Optional. If not provided, the system clock will be used.
absl::Clock* clock = nullptr;
// Optional. If not provided, a default UuidGenerator will be used.
const UuidGenerator* uuid_generator = &UuidGenerator::Default();
// If true, timestamping is disabled.
bool disable_timestamping = false;
};
// WARNING: DO NOT USE IN PRODUCTION.
// WARNING: This signs with UNTRUSTED keys.
//
// Creates a non-prod version of ManifestStoreGenerator, using claim and
// timestamp signers whose certificates are issued by `DefaultTestPki()`.
absl::StatusOr<std::unique_ptr<ManifestStoreGenerator>>
CreateNonProdManifestStoreGenerator(
const NonProdManifestStoreGeneratorOptions& options = {});
} // namespace credentio
#endif // THIRD_PARTY_CREDENTIO_TESTING_NONPROD_GENERATOR_H_