aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockEnclaveAccessService.java
blob: c9c552d8b8d32e5feaf48ed5c0b4fd5d12fb6057 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.aws;

import com.yahoo.config.provision.CloudAccount;

import java.util.Set;
import java.util.TreeSet;

/**
 * @author jonmv
 */
public class MockEnclaveAccessService implements EnclaveAccessService {

    private volatile Set<CloudAccount> currentAccounts = new TreeSet<>();

    public Set<CloudAccount> currentAccounts() { return currentAccounts; }

    @Override
    public double allowAccessFor(Set<CloudAccount> accounts) {
        currentAccounts = new TreeSet<>(accounts);
        return 1;
    }

}