@osmit-gmbh/pulumi-authentik
Version:
A Pulumi package for creating and managing authentik cloud resources.
131 lines • 7.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.SourceOauth = 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";
* import * as authentik from "@pulumi/authentik";
*
* // Create OAuth Source using an existing provider
* const default-source-authentication = authentik.getFlow({
* slug: "default-source-authentication",
* });
* const default-source-enrollment = authentik.getFlow({
* slug: "default-source-enrollment",
* });
* const name = new authentik.SourceOauth("name", {
* name: "discord",
* slug: "discord",
* authenticationFlow: default_source_authentication.then(default_source_authentication => default_source_authentication.id),
* enrollmentFlow: default_source_enrollment.then(default_source_enrollment => default_source_enrollment.id),
* providerType: "discord",
* consumerKey: "foo",
* consumerSecret: "bar",
* });
* ```
*/
class SourceOauth extends pulumi.CustomResource {
/**
* Get an existing SourceOauth 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 SourceOauth(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SourceOauth. 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'] === SourceOauth.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessTokenUrl"] = state ? state.accessTokenUrl : undefined;
resourceInputs["additionalScopes"] = state ? state.additionalScopes : undefined;
resourceInputs["authenticationFlow"] = state ? state.authenticationFlow : undefined;
resourceInputs["authorizationUrl"] = state ? state.authorizationUrl : undefined;
resourceInputs["callbackUri"] = state ? state.callbackUri : undefined;
resourceInputs["consumerKey"] = state ? state.consumerKey : undefined;
resourceInputs["consumerSecret"] = state ? state.consumerSecret : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["enrollmentFlow"] = state ? state.enrollmentFlow : undefined;
resourceInputs["groupMatchingMode"] = state ? state.groupMatchingMode : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["oidcJwks"] = state ? state.oidcJwks : undefined;
resourceInputs["oidcJwksUrl"] = state ? state.oidcJwksUrl : undefined;
resourceInputs["oidcWellKnownUrl"] = state ? state.oidcWellKnownUrl : undefined;
resourceInputs["policyEngineMode"] = state ? state.policyEngineMode : undefined;
resourceInputs["profileUrl"] = state ? state.profileUrl : undefined;
resourceInputs["providerType"] = state ? state.providerType : undefined;
resourceInputs["requestTokenUrl"] = state ? state.requestTokenUrl : undefined;
resourceInputs["slug"] = state ? state.slug : undefined;
resourceInputs["userMatchingMode"] = state ? state.userMatchingMode : undefined;
resourceInputs["userPathTemplate"] = state ? state.userPathTemplate : undefined;
resourceInputs["uuid"] = state ? state.uuid : undefined;
}
else {
const args = argsOrState;
if ((!args || args.consumerKey === undefined) && !opts.urn) {
throw new Error("Missing required property 'consumerKey'");
}
if ((!args || args.consumerSecret === undefined) && !opts.urn) {
throw new Error("Missing required property 'consumerSecret'");
}
if ((!args || args.providerType === undefined) && !opts.urn) {
throw new Error("Missing required property 'providerType'");
}
if ((!args || args.slug === undefined) && !opts.urn) {
throw new Error("Missing required property 'slug'");
}
resourceInputs["accessTokenUrl"] = args ? args.accessTokenUrl : undefined;
resourceInputs["additionalScopes"] = args ? args.additionalScopes : undefined;
resourceInputs["authenticationFlow"] = args ? args.authenticationFlow : undefined;
resourceInputs["authorizationUrl"] = args ? args.authorizationUrl : undefined;
resourceInputs["consumerKey"] = args ? args.consumerKey : undefined;
resourceInputs["consumerSecret"] = (args === null || args === void 0 ? void 0 : args.consumerSecret) ? pulumi.secret(args.consumerSecret) : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["enrollmentFlow"] = args ? args.enrollmentFlow : undefined;
resourceInputs["groupMatchingMode"] = args ? args.groupMatchingMode : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["oidcJwks"] = args ? args.oidcJwks : undefined;
resourceInputs["oidcJwksUrl"] = args ? args.oidcJwksUrl : undefined;
resourceInputs["oidcWellKnownUrl"] = args ? args.oidcWellKnownUrl : undefined;
resourceInputs["policyEngineMode"] = args ? args.policyEngineMode : undefined;
resourceInputs["profileUrl"] = args ? args.profileUrl : undefined;
resourceInputs["providerType"] = args ? args.providerType : undefined;
resourceInputs["requestTokenUrl"] = args ? args.requestTokenUrl : undefined;
resourceInputs["slug"] = args ? args.slug : undefined;
resourceInputs["userMatchingMode"] = args ? args.userMatchingMode : undefined;
resourceInputs["userPathTemplate"] = args ? args.userPathTemplate : undefined;
resourceInputs["uuid"] = args ? args.uuid : undefined;
resourceInputs["callbackUri"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["consumerSecret"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(SourceOauth.__pulumiType, name, resourceInputs, opts);
}
}
exports.SourceOauth = SourceOauth;
/** @internal */
SourceOauth.__pulumiType = 'authentik:index/sourceOauth:SourceOauth';
//# sourceMappingURL=sourceOauth.js.map