import * as ec2 from "../../aws-ec2";
import * as ecr from "../../aws-ecr";
import * as iam from "../../aws-iam";
import * as secretsmanager from "../../aws-secretsmanager";
/**
 * (experimental) Represents credentials used to access a Docker registry.
 *
 * @experimental
 */
export declare abstract class DockerCredential {
    protected readonly usages?: DockerCredentialUsage[] | undefined;
    /**
     * (experimental) Creates a DockerCredential for DockerHub.
     *
     * Convenience method for `fromCustomRegistry('index.docker.io', opts)`.
     *
     * @experimental
     */
    static dockerHub(secret: secretsmanager.ISecret, opts?: ExternalDockerCredentialOptions): DockerCredential;
    /**
     * (experimental) Creates a DockerCredential for a registry, based on its domain name (e.g., 'www.example.com').
     *
     * @experimental
     */
    static customRegistry(registryDomain: string, secret: secretsmanager.ISecret, opts?: ExternalDockerCredentialOptions): DockerCredential;
    /**
     * (experimental) Creates a DockerCredential for one or more ECR repositories.
     *
     * NOTE - All ECR repositories in the same account and region share a domain name
     * (e.g., 0123456789012.dkr.ecr.eu-west-1.amazonaws.com), and can only have one associated
     * set of credentials (and DockerCredential). Attempting to associate one set of credentials
     * with one ECR repo and another with another ECR repo in the same account and region will
     * result in failures when using these credentials in the pipeline.
     *
     * @experimental
     */
    static ecr(repositories: ecr.IRepository[], opts?: EcrDockerCredentialOptions): DockerCredential;
    /**
     * @experimental
     */
    constructor(usages?: DockerCredentialUsage[] | undefined);
    /**
     * Determines if this credential is relevant to the input usage.
     * @internal
     */
    _applicableForUsage(usage: DockerCredentialUsage): boolean;
    /**
     * (experimental) Grant read-only access to the registry credentials.
     *
     * This grants read access to any secrets, and pull access to any repositories.
     *
     * @experimental
     */
    abstract grantRead(grantee: iam.IGrantable, usage: DockerCredentialUsage): void;
    /**
     * Creates and returns the credential configuration, to be used by `cdk-assets`
     * to support the `docker-credential-cdk-assets` tool for `docker login`.
     * @internal
     */
    abstract _renderCdkAssetsConfig(): DockerCredentialCredentialSource;
}
/**
 * (experimental) Options for defining credentials for a Docker Credential.
 *
 * @experimental
 */
export interface ExternalDockerCredentialOptions {
    /**
     * (experimental) The name of the JSON field of the secret which contains the user/login name.
     *
     * @default 'username'
     * @experimental
     */
    readonly secretUsernameField?: string;
    /**
     * (experimental) The name of the JSON field of the secret which contains the secret/password.
     *
     * @default 'secret'
     * @experimental
     */
    readonly secretPasswordField?: string;
    /**
     * (experimental) An IAM role to assume prior to accessing the secret.
     *
     * @default - none. The current execution role will be used.
     * @experimental
     */
    readonly assumeRole?: iam.IRole;
    /**
     * (experimental) Defines which stages of the pipeline should be granted access to these credentials.
     *
     * @default - all relevant stages (synth, self-update, asset publishing) are granted access.
     * @experimental
     */
    readonly usages?: DockerCredentialUsage[];
}
/**
 * (experimental) Options for defining access for a Docker Credential composed of ECR repos.
 *
 * @experimental
 */
export interface EcrDockerCredentialOptions {
    /**
     * (experimental) An IAM role to assume prior to accessing the secret.
     *
     * @default - none. The current execution role will be used.
     * @experimental
     */
    readonly assumeRole?: iam.IRole;
    /**
     * (experimental) Defines which stages of the pipeline should be granted access to these credentials.
     *
     * @default - all relevant stages (synth, self-update, asset publishing) are granted access.
     * @experimental
     */
    readonly usages?: DockerCredentialUsage[];
}
/**
 * (experimental) Defines which stages of a pipeline require the specified credentials.
 *
 * @experimental
 */
export declare enum DockerCredentialUsage {
    /**
     * (experimental) Synth/Build.
     *
     * @experimental
     */
    SYNTH = "SYNTH",
    /**
     * (experimental) Self-update.
     *
     * @experimental
     */
    SELF_UPDATE = "SELF_UPDATE",
    /**
     * (experimental) Asset publishing.
     *
     * @experimental
     */
    ASSET_PUBLISHING = "ASSET_PUBLISHING"
}
/** Format for the CDK assets config. See the cdk-assets `DockerDomainCredentialSource` */
interface DockerCredentialCredentialSource {
    readonly secretsManagerSecretId?: string;
    readonly secretsUsernameField?: string;
    readonly secretsPasswordField?: string;
    readonly ecrRepository?: boolean;
    readonly assumeRoleArn?: string;
}
/**
 * Creates a set of OS-specific buildspec installation commands for setting up the given
 * registries and associated credentials.
 *
 * @param registries - Registries to configure credentials for. It is an error to provide
 * multiple registries for the same domain.
 * @param osType - (optional) Defaults to Linux.
 * @returns An array of commands to configure cdk-assets to use these credentials.
 */
export declare function dockerCredentialsInstallCommands(usage: DockerCredentialUsage, registries?: DockerCredential[], osType?: ec2.OperatingSystemType | 'both'): string[];
export {};
