Skip to content

Commit

Permalink
change secrets to just password
Browse files Browse the repository at this point in the history
  • Loading branch information
prom3theu5 committed Jun 12, 2022
1 parent 8e03d6d commit a3d5eec
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 160 deletions.
32 changes: 10 additions & 22 deletions provider/cmd/pulumi-resource-onepassword/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,7 @@
},
"hostname": {
"type": "string",
"description": "(Only applies to the database category) The address where the database can be found\n",
"secret": true
"description": "(Only applies to the database category) The address where the database can be found\n"
},
"password": {
"type": "string",
Expand All @@ -386,8 +385,7 @@
},
"port": {
"type": "string",
"description": "(Only applies to the database category) The port the database is listening on.\n",
"secret": true
"description": "(Only applies to the database category) The port the database is listening on.\n"
},
"sections": {
"type": "array",
Expand Down Expand Up @@ -417,17 +415,15 @@
},
"username": {
"type": "string",
"description": "Username for this item.\n",
"secret": true
"description": "Username for this item.\n"
},
"uuid": {
"type": "string",
"description": "The UUID of the item. Item identifiers are unique within a specific vault.\n"
},
"vault": {
"type": "string",
"description": "The UUID of the vault the item is in.\n",
"secret": true
"description": "The UUID of the vault the item is in.\n"
}
},
"required": [
Expand All @@ -447,8 +443,7 @@
},
"hostname": {
"type": "string",
"description": "(Only applies to the database category) The address where the database can be found\n",
"secret": true
"description": "(Only applies to the database category) The address where the database can be found\n"
},
"password": {
"type": "string",
Expand All @@ -461,8 +456,7 @@
},
"port": {
"type": "string",
"description": "(Only applies to the database category) The port the database is listening on.\n",
"secret": true
"description": "(Only applies to the database category) The port the database is listening on.\n"
},
"sections": {
"type": "array",
Expand Down Expand Up @@ -492,13 +486,11 @@
},
"username": {
"type": "string",
"description": "Username for this item.\n",
"secret": true
"description": "Username for this item.\n"
},
"vault": {
"type": "string",
"description": "The UUID of the vault the item is in.\n",
"secret": true,
"willReplaceOnChanges": true
}
},
Expand All @@ -519,8 +511,7 @@
},
"hostname": {
"type": "string",
"description": "(Only applies to the database category) The address where the database can be found\n",
"secret": true
"description": "(Only applies to the database category) The address where the database can be found\n"
},
"password": {
"type": "string",
Expand All @@ -533,8 +524,7 @@
},
"port": {
"type": "string",
"description": "(Only applies to the database category) The port the database is listening on.\n",
"secret": true
"description": "(Only applies to the database category) The port the database is listening on.\n"
},
"sections": {
"type": "array",
Expand Down Expand Up @@ -564,8 +554,7 @@
},
"username": {
"type": "string",
"description": "Username for this item.\n",
"secret": true
"description": "Username for this item.\n"
},
"uuid": {
"type": "string",
Expand All @@ -574,7 +563,6 @@
"vault": {
"type": "string",
"description": "The UUID of the vault the item is in.\n",
"secret": true,
"willReplaceOnChanges": true
}
},
Expand Down
12 changes: 0 additions & 12 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,6 @@ func Provider() tfbridge.ProviderInfo {
"password": {
Secret: tfbridge.True(),
},
"username": {
Secret: tfbridge.True(),
},
"vault": {
Secret: tfbridge.True(),
},
"hostname": {
Secret: tfbridge.True(),
},
"port": {
Secret: tfbridge.True(),
},
},
},
},
Expand Down
116 changes: 16 additions & 100 deletions sdk/dotnet/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,7 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
PluginDownloadURL = "https://github.com/SimCubeLtd/pulumi-onepassword/releases/download/v${VERSION}",
AdditionalSecretOutputs =
{
"hostname",
"password",
"port",
"username",
"vault",
},
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
Expand Down Expand Up @@ -218,21 +214,11 @@ public sealed class ItemArgs : Pulumi.ResourceArgs
[Input("database")]
public Input<string>? Database { get; set; }

[Input("hostname")]
private Input<string>? _hostname;

/// <summary>
/// (Only applies to the database category) The address where the database can be found
/// </summary>
public Input<string>? Hostname
{
get => _hostname;
set
{
var emptySecret = Output.CreateSecret(0);
_hostname = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
}
}
[Input("hostname")]
public Input<string>? Hostname { get; set; }

[Input("password")]
private Input<string>? _password;
Expand All @@ -256,21 +242,11 @@ public Input<string>? Password
[Input("passwordRecipe")]
public Input<Inputs.ItemPasswordRecipeArgs>? PasswordRecipe { get; set; }

[Input("port")]
private Input<string>? _port;

/// <summary>
/// (Only applies to the database category) The port the database is listening on.
/// </summary>
public Input<string>? Port
{
get => _port;
set
{
var emptySecret = Output.CreateSecret(0);
_port = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
}
}
[Input("port")]
public Input<string>? Port { get; set; }

[Input("sections")]
private InputList<Inputs.ItemSectionArgs>? _sections;
Expand Down Expand Up @@ -314,37 +290,17 @@ public InputList<string> Tags
[Input("url")]
public Input<string>? Url { get; set; }

[Input("username")]
private Input<string>? _username;

/// <summary>
/// Username for this item.
/// </summary>
public Input<string>? Username
{
get => _username;
set
{
var emptySecret = Output.CreateSecret(0);
_username = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
}
}

[Input("vault", required: true)]
private Input<string>? _vault;
[Input("username")]
public Input<string>? Username { get; set; }

/// <summary>
/// The UUID of the vault the item is in.
/// </summary>
public Input<string>? Vault
{
get => _vault;
set
{
var emptySecret = Output.CreateSecret(0);
_vault = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
}
}
[Input("vault", required: true)]
public Input<string> Vault { get; set; } = null!;

public ItemArgs()
{
Expand All @@ -365,21 +321,11 @@ public sealed class ItemState : Pulumi.ResourceArgs
[Input("database")]
public Input<string>? Database { get; set; }

[Input("hostname")]
private Input<string>? _hostname;

/// <summary>
/// (Only applies to the database category) The address where the database can be found
/// </summary>
public Input<string>? Hostname
{
get => _hostname;
set
{
var emptySecret = Output.CreateSecret(0);
_hostname = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
}
}
[Input("hostname")]
public Input<string>? Hostname { get; set; }

[Input("password")]
private Input<string>? _password;
Expand All @@ -403,21 +349,11 @@ public Input<string>? Password
[Input("passwordRecipe")]
public Input<Inputs.ItemPasswordRecipeGetArgs>? PasswordRecipe { get; set; }

[Input("port")]
private Input<string>? _port;

/// <summary>
/// (Only applies to the database category) The port the database is listening on.
/// </summary>
public Input<string>? Port
{
get => _port;
set
{
var emptySecret = Output.CreateSecret(0);
_port = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
}
}
[Input("port")]
public Input<string>? Port { get; set; }

[Input("sections")]
private InputList<Inputs.ItemSectionGetArgs>? _sections;
Expand Down Expand Up @@ -461,43 +397,23 @@ public InputList<string> Tags
[Input("url")]
public Input<string>? Url { get; set; }

[Input("username")]
private Input<string>? _username;

/// <summary>
/// Username for this item.
/// </summary>
public Input<string>? Username
{
get => _username;
set
{
var emptySecret = Output.CreateSecret(0);
_username = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
}
}
[Input("username")]
public Input<string>? Username { get; set; }

/// <summary>
/// The UUID of the item. Item identifiers are unique within a specific vault.
/// </summary>
[Input("uuid")]
public Input<string>? Uuid { get; set; }

[Input("vault")]
private Input<string>? _vault;

/// <summary>
/// The UUID of the vault the item is in.
/// </summary>
public Input<string>? Vault
{
get => _vault;
set
{
var emptySecret = Output.CreateSecret(0);
_vault = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
}
}
[Input("vault")]
public Input<string>? Vault { get; set; }

public ItemState()
{
Expand Down
16 changes: 0 additions & 16 deletions sdk/go/onepassword/item.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions sdk/nodejs/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,21 +168,21 @@ export class Item extends pulumi.CustomResource {
}
resourceInputs["category"] = args ? args.category : undefined;
resourceInputs["database"] = args ? args.database : undefined;
resourceInputs["hostname"] = args?.hostname ? pulumi.secret(args.hostname) : undefined;
resourceInputs["hostname"] = args ? args.hostname : undefined;
resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined;
resourceInputs["passwordRecipe"] = args ? args.passwordRecipe : undefined;
resourceInputs["port"] = args?.port ? pulumi.secret(args.port) : undefined;
resourceInputs["port"] = args ? args.port : undefined;
resourceInputs["sections"] = args ? args.sections : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["title"] = args ? args.title : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["url"] = args ? args.url : undefined;
resourceInputs["username"] = args?.username ? pulumi.secret(args.username) : undefined;
resourceInputs["vault"] = args?.vault ? pulumi.secret(args.vault) : undefined;
resourceInputs["username"] = args ? args.username : undefined;
resourceInputs["vault"] = args ? args.vault : undefined;
resourceInputs["uuid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["hostname", "password", "port", "username", "vault"] };
const secretOpts = { additionalSecretOutputs: ["password"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Item.__pulumiType, name, resourceInputs, opts);
}
Expand Down
Loading

0 comments on commit a3d5eec

Please sign in to comment.