aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/HostedAthenzIdentities.java
blob: f68c13ec0d420635a6d6cbf8e555bd559346fd09 (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
25
26
27
// 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.athenz;

import com.yahoo.vespa.athenz.api.AthenzDomain;
import com.yahoo.vespa.athenz.api.AthenzService;
import com.yahoo.vespa.athenz.api.AthenzUser;
import com.yahoo.vespa.hosted.controller.api.identifiers.ScrewdriverId;
import com.yahoo.vespa.hosted.controller.api.identifiers.UserId;

/**
 * @author bjorncs
 */
public class HostedAthenzIdentities {

    public static final AthenzDomain SCREWDRIVER_DOMAIN = new AthenzDomain("cd.screwdriver.project");

    private HostedAthenzIdentities() {}

    public static AthenzUser from(UserId userId) {
        return AthenzUser.fromUserId(userId.id());
    }

    public static AthenzService from(ScrewdriverId screwdriverId) {
        return new AthenzService(SCREWDRIVER_DOMAIN, "sd" + screwdriverId.id());
    }

}