@osmit-gmbh/pulumi-authentik
Version:
A Pulumi package for creating and managing authentik cloud resources.
93 lines • 4.11 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.Token = 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 a token for a user
* const name = new authentik.User("name", {
* username: "user",
* name: "User",
* });
* const _default = new authentik.Token("default", {
* identifier: "my-token",
* user: name.id,
* description: "My secret token",
* expires: "2025-01-01T15:04:05Z",
* });
* ```
*/
class Token extends pulumi.CustomResource {
/**
* Get an existing Token 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 Token(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Token. 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'] === Token.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["expires"] = state ? state.expires : undefined;
resourceInputs["expiresIn"] = state ? state.expiresIn : undefined;
resourceInputs["expiring"] = state ? state.expiring : undefined;
resourceInputs["identifier"] = state ? state.identifier : undefined;
resourceInputs["intent"] = state ? state.intent : undefined;
resourceInputs["key"] = state ? state.key : undefined;
resourceInputs["retrieveKey"] = state ? state.retrieveKey : undefined;
resourceInputs["user"] = state ? state.user : undefined;
}
else {
const args = argsOrState;
if ((!args || args.identifier === undefined) && !opts.urn) {
throw new Error("Missing required property 'identifier'");
}
if ((!args || args.user === undefined) && !opts.urn) {
throw new Error("Missing required property 'user'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["expires"] = args ? args.expires : undefined;
resourceInputs["expiring"] = args ? args.expiring : undefined;
resourceInputs["identifier"] = args ? args.identifier : undefined;
resourceInputs["intent"] = args ? args.intent : undefined;
resourceInputs["retrieveKey"] = args ? args.retrieveKey : undefined;
resourceInputs["user"] = args ? args.user : undefined;
resourceInputs["expiresIn"] = undefined /*out*/;
resourceInputs["key"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["key"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Token.__pulumiType, name, resourceInputs, opts);
}
}
exports.Token = Token;
/** @internal */
Token.__pulumiType = 'authentik:index/token:Token';
//# sourceMappingURL=token.js.map