Skip to content

Conversation

@mlajkim
Copy link
Contributor

@mlajkim mlajkim commented May 21, 2025

Background

The current GItHubActionInstanceProvider does not allow multiple GitHub Action environments with one Athenz ZTS Server.

What's done?

The PR enables you to create your own instance plugin on a separate class as needed with only keys defined:

package com.yahoo.athenz.instance.provider.impl;

import org.slf4j.LoggerFactory;

public class InstanceGithubActionsProviderDev extends InstanceGithubActionsProviderCommon {

    static {
        LOGGER = LoggerFactory.getLogger(InstanceGithubActionsProviderDev.class);

        // Initialize the static variables with specific values for this subclass
        GITHUB_ACTIONS_PROP_PROVIDER_DNS_SUFFIX  = "athenz.zts.github_actions.dev.provider_dns_suffix";
        GITHUB_ACTIONS_PROP_BOOT_TIME_OFFSET     = "athenz.zts.github_actions.dev.boot_time_offset";
        GITHUB_ACTIONS_PROP_CERT_EXPIRY_TIME     = "athenz.zts.github_actions.dev.cert_expiry_time";
        GITHUB_ACTIONS_PROP_ENTERPRISE           = "athenz.zts.github_actions.dev.enterprise";
        GITHUB_ACTIONS_PROP_AUDIENCE             = "athenz.zts.github_actions.dev.audience";
        GITHUB_ACTIONS_PROP_ISSUER               = "athenz.zts.github_actions.dev.issuer";
        GITHUB_ACTIONS_PROP_JWKS_URI             = "athenz.zts.github_actions.dev.jwks_uri";
    }
}

This way we can create multiple classes with multiple configurations as the following in zts.properties, without duplicated logic code:

# Configuration for InstanceGithubActionsProvider
athenz.zts.github_actions.jwks_uri=https://git.internal.com/_services/token/.well-known/jwks
athenz.zts.github_actions.provider_dns_suffix=git.internal.com
athenz.zts.github_actions.issuer=https://git.internal.com/_services/token
athenz.zts.github_actions.enterprise=internal-corp-inc
athenz.zts.github_actions.audience=https://git.internal.com/
athenz.zts.github_actions.cert_expiry_time=43200

# Configuration for InstanceGithubActionsDevProvider
athenz.zts.github_actions.dev.jwks_uri=https://git-dev.linecorp.com/_services/token/.well-known/jwks
athenz.zts.github_actions.dev.provider_dns_suffix=git-dev.internal.com
athenz.zts.github_actions.dev.issuer=https://git-dev.internal.com/_services/token
athenz.zts.github_actions.dev.enterprise=internal-corp
athenz.zts.github_actions.dev.audience=https://git-dev.internal.com/
athenz.zts.github_actions.dev.cert_expiry_time=43200

@mlajkim mlajkim marked this pull request as draft May 21, 2025 00:25
@mlajkim mlajkim changed the title [DNM] [Prototype] GitHub Action with Multiple Configurations [DNM] [Prototype] GitHub Action with Multiple Configurations using CommonClass Jun 5, 2025
@mlajkim mlajkim force-pushed the prototype/multiple-configurations-for-github-action branch from 6d4724c to 94ccbc6 Compare June 5, 2025 03:36
mlajkim and others added 16 commits June 5, 2025 14:04
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Aaron Jeongwoo Kim <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Bumps [undici](https://github.com/nodejs/undici) from 6.21.1 to 6.21.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v6.21.1...v6.21.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.21.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Bumps [multer](https://github.com/expressjs/multer) from 1.4.5-lts.1 to 2.0.0.
- [Release notes](https://github.com/expressjs/multer/releases)
- [Changelog](https://github.com/expressjs/multer/blob/v2.0.0/CHANGELOG.md)
- [Commits](expressjs/multer@v1.4.5-lts.1...v2.0.0)

---
updated-dependencies:
- dependency-name: multer
  dependency-version: 2.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Henry Avetisyan <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
…do not change (AthenZ#2966)

* update modified
---------
Signed-off-by: Takuya Matsumoto <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Henry Avetisyan <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Henry Avetisyan <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Henry Avetisyan <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Po-Yao Chen <[email protected]>
Co-authored-by: Po-Yao Chen <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Henry Avetisyan <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
Signed-off-by: Henry Avetisyan <[email protected]>
Signed-off-by: Jeongwoo Kim - jekim <[email protected]>
@mlajkim mlajkim force-pushed the prototype/multiple-configurations-for-github-action branch from 36bb50d to 7f337a2 Compare June 5, 2025 05:09
@mlajkim
Copy link
Contributor Author

mlajkim commented Jul 16, 2025

Closed as #2992 has been selected as a solution for the multiple configurations (environments) feature

@mlajkim mlajkim closed this Jul 16, 2025
@mlajkim mlajkim deleted the prototype/multiple-configurations-for-github-action branch July 16, 2025 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants