Options for varying obligation "timeout"

Say I want to modify the “timeout” for an obligation in a non-PROD environment, what are my options?

The motivating example is I want to change the timeout from 1 day to 5 minutes in non-PROD environments for this code:

protocol[admin, customer] KYC(var user) {

    ...
    var startKycTime: Optional<DateTime> = optionalOf<DateTime>();

    permission[admin] startKYCProcess() | created {
        require(!identId.isPresent(), "identId should not exist");
        notify startKYC(this.returnKYCSubmissionData[admin](), user);
        startKycTime = optionalOf(now());
        become kyc_started;
    };

   ...

    @api
    obligation[admin] onWebhookStatus(kycResultData: KYCResultsData) before startKycTime.getOrFail().plus(days(1)) {
   ...
}

Hi Stuart,

This question is highly dependent on the overall modelling. Here are a few suggestions, and I am sure more alternatives do exist!

  1. Use a party claim to define the environment. Some attributes such as the issuer iss hold information about the environment, if your project instantiated the protocols with an issuer inside the claim.
  2. Use protocol seeding with an environment parameter in the migration.yml file, with run-only: test for example, in order to pass the environment variable into NPL, and pass it through protocols until where you need it.
  3. (not recommended, but maybe easier for you) If you have a middle layer, like an API, then you can add an argument to the permission instantiating the KYC protocol above. The argument would depend on an environment variable to define which delay it is

Let me know if you need more info about any solution, and if you can find a suitable one in the list.

I’ll also make sure there is a reference for how to solve this use-case

Thanks @jean . I was hoping to avoid options 2 or 3 but I think this is the only way currently.