pub async fn vaultpolicy(conf: &Config, region: &Region, team_name: &str) -> Result<String> {
    let mfs = shipcat_filebacked::all(conf).await?;
    let team = if let Some(s) = conf.owners.squads.get(team_name) {
        if s.github.admins.is_none() {
            warn!(
                "Squad '{}' does not define a github.admins team in teams.yml",
                s.name
            );
        }
        s.name.clone()
    } else {
        bail!("Squad '{}' does not exist in teams.yml", team_name)
    };
    let output = region
        .vault
        .make_policy(mfs, &team, region.environment.clone())
        .await?;
    println!("{}", output);
    Ok(output)
}
/// Generate vault policies based on team admins of services
///
/// Cross refereneces config.teams with manifest.metadata.team
/// The output is the same across all regions to avoid chicken-egg problems.
/// Introducing services to dev first, where dev vault section is open solves this.
///
/// Usage:
/// shipcat get vaultpolicy teamname | vault policy write github-team-name -
/// vault write auth/github/map/teams/github-team-name value=github-team-name
///
/// Assumes you have setup github provider using right organisation.
/// vault write auth/github/config organization={GithubOrganisation}
Generate vault policies based on team admins of services
Cross refereneces config.teams with manifest.metadata.team
The output is the same across all regions to avoid chicken-egg problems.
Introducing services to dev first, where dev vault section is open solves this.



Assumes you have setup github provider using right organisation.
vault write auth/github/config organization={GithubOrganisation}
Generate vault policies based on team admins of services Cross refereneces config . teams with manifest . metadata . team The output is the same across all regions to avoid chicken - egg problems . Introducing services to dev first where dev vault section is open solves this . Assumes you have setup github provider using right organisation . vault write auth / github / config organization = { GithubOrganisation }
pub async fn vaultpolicy(conf: &Config, region: &Region, team_name: &str) -> Result<String> {
    let mfs = shipcat_filebacked::all(conf).await?;
    let team = if let Some(s) = conf.owners.squads.get(team_name) {
        if s.github.admins.is_none() {
            warn!(
                "Squad '{}' does not define a github.admins team in teams.yml",
                s.name
            );
        }
        s.name.clone()
    } else {
        bail!("Squad '{}' does not exist in teams.yml", team_name)
    };
    let output = region
        .vault
        .make_policy(mfs, &team, region.environment.clone())
        .await?;
    println!("{}", output);
    Ok(output)
}
pub async fn vaultpolicy ( conf : & Config , region : & Region , team_name : & str ) -> Result < String > { let mfs = shipcat_filebacked :: all ( conf ) . await ? ; let team = if let Some ( s ) = conf . owners . squads . get ( team_name ) { if s . github . admins . is_none ( ) { warn ! ( " " s name ) ; } s . name . clone ( ) } else { bail ! ( " " team_name ) } ; let output = region . vault . make_policy ( mfs , & team , region . environment . clone ( ) ) . await ? ; println ! ( " " output ) ; Ok ( output ) }
Generate vault policies based on team admins of services
Cross refereneces config.teams with manifest.metadata.team
The output is the same across all regions to avoid chicken-egg problems.
Generate vault policies based on team admins of services Cross refereneces config . teams with manifest . metadata . team The output is the same across all regions to avoid chicken - egg problems .
conf
&Config
region
&Region
team_name
&str
conf
&Config
region
&Region
team_name
&str