Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections and suggestion #1

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
350 changes: 184 additions & 166 deletions src/bwdc.ts
Original file line number Diff line number Diff line change
@@ -1,197 +1,215 @@
const bwLogo32x32 = "https://bitwarden.com/images/icon_32x32.png";
const completionSpec: Fig.Spec = {

name: "bwdc",
description: "Bitwarden Directory Connector",
subcommands: [{
name: "login",
icon: bwLogo32x32,
description: "Log in to Directory Connector",
args: [
{
name: "client_id",
description: "Email Address of Bitwarden Account",
isOptional: true,
},
{
name: "client_secret",
description: "Master Password of Bitwarden Vault",
isOptional: true,
},
],
options: [{
name: "--help",
}]
},
{
name: "logout",
icon: bwLogo32x32,
description: "Log out of Directory Connector",
subcommands: [
{
name: "login",
icon: bwLogo32x32,
description: "Log in to Directory Connector",
args: [
{
name: "client_id",
description: "Organisation API client_id",
isOptional: true,
},
{
name: "client_secret",
description: "Organisation API client_secret",
isOptional: true,
},
],
options: [
{
name: "--help",
},
],
},
{
name: "logout",
icon: bwLogo32x32,
description: "Log out of Directory Connector",

options: [{
name: "--help",
}]
},
{
name: "test",
icon: bwLogo32x32,
description: "Prints a JSON formatted array of groups and users that would be synced to your Bitwarden organization",
options: [
{
name: "--help",
},
],
},
{
name: "test",
icon: bwLogo32x32,
description:
"Prints a JSON formatted array of groups and users that would be synced to your Bitwarden organization",

options: [{
name: "--last",
description: "Test only the changes since the last successful sync",
options: [
{
name: "--last",
description: "Test only the changes since the last successful sync",
},
{
name: "--help",
},
],
},
{
name: "--help",
}]
},
{
name: "sync",
icon: bwLogo32x32,
description: "Run a live sync operation and push data to your Bitwarden organization",
name: "sync",
icon: bwLogo32x32,
description:
"Run a live sync operation and push data to your Bitwarden organization",

options: [{
name: "--help",
}]
},
{
name: "last-sync",
icon: bwLogo32x32,
description: "The last-sync command returns an ISO 8601 timestamp for the last sync operation that was performed for users or groups. You must specify either users or groups as an <object> to run the command against- Returns an empty response if no sync has been performed for the given object",
args: {
options: [
{
name: "--help",
},
],
},
{
name: "last-sync",
icon: bwLogo32x32,
description:
"The last-sync command returns an ISO 8601 timestamp for the last sync operation that was performed for users or groups. You must specify either users or groups as an <object> to run the command against- Returns an empty response if no sync has been performed for the given object",
args: {
name: "Object",
description: "You must specify either users or groups as an <object> to run the command against",

},

options: [{
name: "--help",
}]
},

{
name: "config",
icon: bwLogo32x32,
description: "The last-sync command returns an ISO 8601 timestamp for the last sync operation that was performed for users or groups. You must specify either users or groups as an <object> to run the command against- Returns an empty response if no sync has been performed for the given object",
args: [
{
name: "setting",
description: "Specify the setting to configure",


},
{
name: "value",
description: "Specify the value assigned to the setting",

description:
"You must specify either users or groups as an <object> to run the command against",
},
],

subcommands: [{
name: "server",
description: "URL of your self-hosted installation (e.g. https://business.bitwarden.com) or EU server (https://vault.bitwarden.eu)",
args: {
name: "server-url",
description: "Specify the server URL",


}
options: [
{
name: "--help",
},
],
},

{
name: "directory",
description: "Type of directory to use",
args: {
name: "directory-type",
description: `Active Directory/LDAP : 0
name: "config",
icon: bwLogo32x32,
description:
"The config command allows you to specify your directory settings",
args: [
{
name: "setting",
description: "Specify the setting to configure",
},
{
name: "value",
description: "Specify the value assigned to the setting",
},
],

subcommands: [
{
name: "server",
description:
"URL of your self-hosted installation (e.g. https://my.url.com) or https://vault.bitwarden.eu",
args: {
name: "server-url",
description: "Specify the server URL",
},
},
{
name: "directory",
description: "Type of directory to use",
args: {
name: "directory-type",
description: `Active Directory/LDAP : 0
Azure Active Directory : 1
Google Workspace/GSuite : 2
Okta : 3
OneLogin : 4`,

suggestions: [
{ name: "0", description: "Active Directory/LDAP" },
{ name: "1", description: "Azure Active Directory" },
{ name: "2", description: "Google Workspace/GSuite" },
{ name: "3", description: "Okta" },
{ name: "4", description: "OneLogin" },
],

}
suggestions: [
{ name: "0", description: "Active Directory/LDAP" },
{ name: "1", description: "Azure Active Directory" },
{ name: "2", description: "Google Workspace/GSuite" },
{ name: "3", description: "Okta" },
{ name: "4", description: "OneLogin" },
],
},
},
{
name: "ldap.password",
description: "Password for connection to the LDAP server",
args: {
name: "password",
description: "Specify the password",
},
},
{
name: "azure.key",
description: "Azure AD secret key",
args: {
name: "key",
description: "Specify the AD secret key",
},
},
{
name: "gsuite.key",
description: "Google Workspace/GSuite private key",
args: {
name: "key",
description: "Specify the Google Workspace/GSuite private key",
},
},
{
name: "okta.token",
description: "Okta token",
args: {
name: "token",
description: "Specify the Okta token",
},
},
{
name: "onelogin.secret",
description: "OneLogin client secret",
args: {
name: "secret",
description: "Specify the OneLogin client secret",
},
},
],
options: [
{
name: "--help",
},
],
},
{
name: "ldap.password",
description: "Password for connection to the LDAP server",
args: {
name: "password",
description: "Specify the password",
}
},
{
name: "azure.key",
description: "Azure AD secret key",
args: {
name: "key",
description: "Specify the AD secret key",
}
name: "data-file",
icon: bwLogo32x32,
description: "Path to data.json database file",

options: [
{
name: "--help",
},
],
},
{
name: "gsuite.key",
description: "Google Workspace/GSuite private key",
args: {
name: "key",
description: "Specify the Google Workspace/GSuite private key",
}
name: "clear-cache",
icon: bwLogo32x32,
description:
"The clear-cache command allows you to clear cached data that the application stores while performing sync operations",
options: [
{
name: "--help",
},
],
},
{
name: "okta.token",
description: "Okta token",
args: {
name: "token",
description: "Specify the Okta token",
}
name: "update",
icon: bwLogo32x32,
description:
"The update command allows you to check if your Directory Connector CLI is up-to-date",
},
],
options: [
{
name: "onelogin.secret",
description: "OneLogin client secret",
args: {
name: "secret",
description: "Specify the OneLogin client secret",
}
}
],
options: [{
name: "--help",
}]
},
{
name: "data-file",
icon: bwLogo32x32,
description: "Path to data.json database file",

options: [{
name: "--help",
}]

},
{
name: "clear-cache",
icon: bwLogo32x32,
description: "The clear-cache command allows you to clear cached data that the application stores while performing sync operations",
options: [{
name: "--help",
}]
},
{
name: "update",
icon: bwLogo32x32,
description: "The update command allows you to check if your Directory Connector CLI is up-to-date",
}
description: "Show help for bwdc",
},
],
options: [{
name: "--help",
description: "Show help for bwdc",
}],
// Only uncomment if bwdc takes an argument
// args: {}
};
export default completionSpec;
export default completionSpec;