@osmit-gmbh/pulumi-authentik
Version:
A Pulumi package for creating and managing authentik cloud resources.
117 lines • 6.43 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProviderOauth2 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as authentik from "@osmit-gmbh/pulumi-authentik";
*
* // Create an OAuth2 Provider
* const name = new authentik.ProviderOauth2("name", {
* name: "grafana",
* clientId: "grafana",
* allowedRedirectUris: [{
* matching_mode: "strict",
* url: "http://localhost",
* }],
* });
* const nameApplication = new authentik.Application("name", {
* name: "test app",
* slug: "test-app",
* protocolProvider: name.id,
* });
* ```
*/
class ProviderOauth2 extends pulumi.CustomResource {
/**
* Get an existing ProviderOauth2 resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new ProviderOauth2(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ProviderOauth2. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ProviderOauth2.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessCodeValidity"] = state ? state.accessCodeValidity : undefined;
resourceInputs["accessTokenValidity"] = state ? state.accessTokenValidity : undefined;
resourceInputs["allowedRedirectUris"] = state ? state.allowedRedirectUris : undefined;
resourceInputs["authenticationFlow"] = state ? state.authenticationFlow : undefined;
resourceInputs["authorizationFlow"] = state ? state.authorizationFlow : undefined;
resourceInputs["clientId"] = state ? state.clientId : undefined;
resourceInputs["clientSecret"] = state ? state.clientSecret : undefined;
resourceInputs["clientType"] = state ? state.clientType : undefined;
resourceInputs["encryptionKey"] = state ? state.encryptionKey : undefined;
resourceInputs["includeClaimsInIdToken"] = state ? state.includeClaimsInIdToken : undefined;
resourceInputs["invalidationFlow"] = state ? state.invalidationFlow : undefined;
resourceInputs["issuerMode"] = state ? state.issuerMode : undefined;
resourceInputs["jwksSources"] = state ? state.jwksSources : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["propertyMappings"] = state ? state.propertyMappings : undefined;
resourceInputs["refreshTokenValidity"] = state ? state.refreshTokenValidity : undefined;
resourceInputs["signingKey"] = state ? state.signingKey : undefined;
resourceInputs["subMode"] = state ? state.subMode : undefined;
}
else {
const args = argsOrState;
if ((!args || args.authorizationFlow === undefined) && !opts.urn) {
throw new Error("Missing required property 'authorizationFlow'");
}
if ((!args || args.clientId === undefined) && !opts.urn) {
throw new Error("Missing required property 'clientId'");
}
if ((!args || args.invalidationFlow === undefined) && !opts.urn) {
throw new Error("Missing required property 'invalidationFlow'");
}
resourceInputs["accessCodeValidity"] = args ? args.accessCodeValidity : undefined;
resourceInputs["accessTokenValidity"] = args ? args.accessTokenValidity : undefined;
resourceInputs["allowedRedirectUris"] = args ? args.allowedRedirectUris : undefined;
resourceInputs["authenticationFlow"] = args ? args.authenticationFlow : undefined;
resourceInputs["authorizationFlow"] = args ? args.authorizationFlow : undefined;
resourceInputs["clientId"] = args ? args.clientId : undefined;
resourceInputs["clientSecret"] = (args === null || args === void 0 ? void 0 : args.clientSecret) ? pulumi.secret(args.clientSecret) : undefined;
resourceInputs["clientType"] = args ? args.clientType : undefined;
resourceInputs["encryptionKey"] = args ? args.encryptionKey : undefined;
resourceInputs["includeClaimsInIdToken"] = args ? args.includeClaimsInIdToken : undefined;
resourceInputs["invalidationFlow"] = args ? args.invalidationFlow : undefined;
resourceInputs["issuerMode"] = args ? args.issuerMode : undefined;
resourceInputs["jwksSources"] = args ? args.jwksSources : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["propertyMappings"] = args ? args.propertyMappings : undefined;
resourceInputs["refreshTokenValidity"] = args ? args.refreshTokenValidity : undefined;
resourceInputs["signingKey"] = args ? args.signingKey : undefined;
resourceInputs["subMode"] = args ? args.subMode : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["clientSecret"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ProviderOauth2.__pulumiType, name, resourceInputs, opts);
}
}
exports.ProviderOauth2 = ProviderOauth2;
/** @internal */
ProviderOauth2.__pulumiType = 'authentik:index/providerOauth2:ProviderOauth2';
//# sourceMappingURL=providerOauth2.js.map