@tigrisdata/cli 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/client.js +1 -1
- package/dist/auth/config.js +1 -1
- package/dist/auth/s3-client.js +1 -1
- package/dist/auth/storage.js +1 -1
- package/dist/cli.js +5 -5
- package/dist/constants.js +1 -0
- package/dist/index.js +5 -5
- package/dist/lib/access-keys/assign.js +3 -3
- package/dist/lib/access-keys/create.js +3 -3
- package/dist/lib/access-keys/delete.js +3 -3
- package/dist/lib/access-keys/get.js +3 -3
- package/dist/lib/access-keys/list.js +8 -8
- package/dist/lib/buckets/create.js +2 -2
- package/dist/lib/buckets/delete.js +2 -2
- package/dist/lib/buckets/get.js +7 -7
- package/dist/lib/buckets/list.js +7 -7
- package/dist/lib/buckets/set.js +2 -2
- package/dist/lib/configure/index.js +2 -2
- package/dist/lib/cp.js +1 -1
- package/dist/lib/credentials/test.js +2 -2
- package/dist/lib/forks/create.js +2 -2
- package/dist/lib/forks/list.js +7 -7
- package/dist/lib/login/credentials.js +2 -2
- package/dist/lib/login/oauth.js +3 -3
- package/dist/lib/login/select.js +4 -4
- package/dist/lib/logout.js +2 -2
- package/dist/lib/ls.js +5 -5
- package/dist/lib/mk.js +1 -1
- package/dist/lib/mv.js +1 -1
- package/dist/lib/objects/delete.js +2 -2
- package/dist/lib/objects/get.js +2 -2
- package/dist/lib/objects/list.js +7 -7
- package/dist/lib/objects/put.js +6 -6
- package/dist/lib/organizations/create.js +3 -3
- package/dist/lib/organizations/list.js +7 -7
- package/dist/lib/organizations/select.js +5 -5
- package/dist/lib/rm.js +1 -1
- package/dist/lib/snapshots/list.js +6 -6
- package/dist/lib/snapshots/take.js +2 -2
- package/dist/lib/touch.js +1 -1
- package/dist/lib/whoami.js +3 -3
- package/dist/specs.yaml +131 -81
- package/package.json +4 -2
package/dist/lib/whoami.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{listOrganizations as
|
|
2
|
-
`),e&&(
|
|
3
|
-
`))}catch(
|
|
1
|
+
import{listOrganizations as Ae}from"@tigrisdata/iam";import S from"axios";import re from"open";var d="https://t3.storage.dev",E="https://iam.storageapi.dev";function h(){let n=process.env.TIGRIS_ENV==="development",e=process.env.AUTH0_DOMAIN||n?"auth-dev.tigris.dev":"auth.tigris.dev",t=process.env.AUTH0_CLIENT_ID||n?"JdJVYIyw0O1uHi5L5OJH903qaWBgd3gF":"DMejqeM3CQ4IqTjEcd3oA9eEiT40hn8D",o=process.env.AUTH0_AUDIENCE||n?"https://tigris-api-dev":"https://tigris-os-api";return{domain:e,clientId:t,audience:o}}var b=process.env.TIGRIS_CLAIMS_NAMESPACE||"https://tigris";function L(){return process.env.TIGRIS_STORAGE_ENDPOINT||process.env.TIGRIS_IAM_ENDPOINT?{endpoint:process.env.TIGRIS_STORAGE_ENDPOINT||d,iamEndpoint:process.env.TIGRIS_IAM_ENDPOINT||E}:{endpoint:process.env.AWS_ENDPOINT_URL_S3||d,iamEndpoint:process.env.AWS_ENDPOINT_URL_IAM||E}}import{homedir as G}from"os";import{join as g}from"path";import{readFileSync as ee,writeFileSync as ne,existsSync as C,mkdirSync as te}from"fs";import{loadSharedConfigFiles as ie}from"@smithy/shared-ini-file-loader";import{chmod as oe}from"fs/promises";var v=g(G(),".tigris"),y=g(v,"config.json");function se(){C(v)||te(v,{recursive:!0,mode:448})}function c(){if(C(y))try{let n=ee(y,"utf8");return JSON.parse(n)}catch{return{}}return{}}async function T(n){se(),ne(y,JSON.stringify(n,null,2),{mode:384});try{await oe(y,384)}catch{}}async function x(n){let e=c();e.tokens=n,await T(e)}async function p(){return c().tokens||null}async function k(){let n=c();delete n.tokens,await T(n)}async function F(n){let e=c();e.organizations=n,await T(e)}function U(){return c().organizations||[]}function u(){return c().selectedOrganization||null}function O(){if(process.env.TIGRIS_STORAGE_ACCESS_KEY_ID||process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY){let o=process.env.TIGRIS_STORAGE_ACCESS_KEY_ID,i=process.env.TIGRIS_STORAGE_SECRET_ACCESS_KEY;if(!o||!i)return null;let s=process.env.TIGRIS_STORAGE_ENDPOINT||d;return{accessKeyId:o,secretAccessKey:i,endpoint:s}}let n=process.env.AWS_ACCESS_KEY_ID,e=process.env.AWS_SECRET_ACCESS_KEY;if(!n||!e)return null;let t=process.env.AWS_ENDPOINT_URL_S3||d;return{accessKeyId:n,secretAccessKey:e,endpoint:t}}function $(){if(!process.env.AWS_PROFILE)return!1;let n=g(G(),".aws");return C(g(n,"credentials"))||C(g(n,"config"))}async function j(n){try{let{configFile:e}=await ie(),t=e[n];return t?{endpoint:t.endpoint_url_s3||t.endpoint_url,iamEndpoint:t.endpoint_url_iam,region:t.region}:{}}catch{return{}}}function W(){let n=c();return O()||n.temporaryCredentials||n.credentials||null}function P(){let n=c();return n.temporaryCredentials||n.credentials||null}async function Y(n){let e=c();e.loginMethod=n,await T(e)}function A(){return c().loginMethod||null}var M=class{config;baseUrl;constructor(){this.config=h(),this.baseUrl=`https://${this.config.domain}`}async login(e){let o=(await S.post(`${this.baseUrl}/oauth/device/code`,{client_id:this.config.clientId,audience:this.config.audience,scope:"openid profile email offline_access"},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data;e?.onDeviceCode?.(o.user_code,o.verification_uri),await this.sleep(2e3);try{await re(o.verification_uri_complete)}catch{}e?.onWaiting?.();let i=await this.pollForToken(o.device_code,o.interval||5);await x(i),Y("oauth"),await this.extractAndStoreOrganizations(i.idToken)}async pollForToken(e,t){let i=0;for(;i<60;){i++;try{let r=(await S.post(`${this.baseUrl}/oauth/token`,{client_id:this.config.clientId,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data,a=Date.now()+(r.expires_in||3600)*1e3;return{accessToken:r.access_token,refreshToken:r.refresh_token,idToken:r.id_token,expiresAt:a}}catch(s){if(S.isAxiosError(s)&&s.response){let r=s.response.data?.error;if(r==="authorization_pending"){await this.sleep(t*1e3);continue}if(r==="slow_down"){t+=5,await this.sleep(t*1e3);continue}throw new Error(s.response.data?.error_description||"Authentication failed")}throw s}}throw new Error("Authentication timed out. Please try again.")}async getAccessToken(){let e=await p();if(!e)throw new Error('Not authenticated. Please run "tigris login" to authenticate.');let t=300*1e3;return Date.now()+t>=e.expiresAt&&(e=await this.refreshAccessToken(e)),e.accessToken}async refreshAccessToken(e){let t=null;if(e?.refreshToken?t=e:t=await p(),!t)throw new Error('No refresh token available. Please run "tigris login" to re-authenticate.');try{let i=(await S.post(`${this.baseUrl}/oauth/token`,{client_id:this.config.clientId,grant_type:"refresh_token",refresh_token:t.refreshToken,scope:"openid profile email offline_access"},{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data,s={accessToken:i.access_token,refreshToken:i.refresh_token||t.refreshToken,idToken:i.id_token||t.idToken,expiresAt:Date.now()+(i.expires_in||3600)*1e3};return await x(s),s}catch{throw await k(),new Error('Token refresh failed. Please run "tigris login" to re-authenticate.')}}async getIdTokenClaims(){let e=await p();if(!e||!e.idToken)throw new Error('Not authenticated. Please run "tigris login" to authenticate.');try{let t=e.idToken.split(".")[1],o=Buffer.from(t,"base64").toString("utf8");return JSON.parse(o)}catch{throw new Error("Failed to decode ID token")}}async extractAndStoreOrganizations(e){if(e)try{let t=e.split(".")[1],o=Buffer.from(t,"base64").toString("utf8"),s=JSON.parse(o)[b];if(!s)return;let r=s?.ns?.map(a=>typeof a=="object"&&a!==null?{id:a.id,name:a.name,displayName:a.name}:{id:a,name:a,displayName:a})||[];if(r.length===0)return;F(r)}catch{}}async getOrganizations(){return await this.getAccessToken(),U()}async logout(){await k()}async isAuthenticated(){return await p()!==null}sleep(e){return new Promise(t=>setTimeout(t,e))}},N=null;function _(){return N||(N=new M),N}import{S3Client as Le}from"@aws-sdk/client-s3";import{fromIni as ae}from"@aws-sdk/credential-providers";var w=L(),ce=h();async function de(){return A()}async function V(){if($()){let o=process.env.AWS_PROFILE||"default",i=await j(o),s=await ae({profile:o})();return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,endpoint:i.endpoint||w.endpoint||d,iamEndpoint:i.iamEndpoint||w.iamEndpoint}}let n=await de();if(n==="oauth"){let i=await _().getAccessToken();if(!u())throw new Error('No organization selected. Please run "tigris orgs select" first.');return{sessionToken:i,accessKeyId:"",secretAccessKey:"",endpoint:w.endpoint,organizationId:u()??void 0,iamEndpoint:w.iamEndpoint,authDomain:ce.domain}}if(n==="credentials"){let o=P();if(o)return{accessKeyId:o.accessKeyId,secretAccessKey:o.secretAccessKey,endpoint:o.endpoint}}let e=O();if(e)return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,endpoint:e.endpoint};let t=P();if(t)return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,endpoint:t.endpoint};throw new Error('Not authenticated. Please run "tigris login" or "tigris configure" first.')}import{readFileSync as le,existsSync as ge}from"fs";import{join as q,dirname as pe}from"path";import{fileURLToPath as ue}from"url";import*as H from"yaml";var fe=ue(import.meta.url),me=pe(fe),D=null;function he(){let n=me;for(let e=0;e<5;e++){let t=q(n,"specs.yaml");if(ge(t))return t;n=q(n,"..")}throw new Error("Could not find specs.yaml")}function Ce(){if(!D){let n=he(),e=le(n,"utf8");D=H.parse(e)}return D}function J(n,e){let o=Ce().commands.find(i=>i.name===n);return o?e&&o.operations?o.operations.find(i=>i.name===e)||null:o:null}var ye={success:"\u2714",failure:"\u2716",hint:"\u2192"};function Te(){return process.stdout.isTTY===!0}function B(n){let e=J(n.command,n.operation);if(e)return e.messages}function Q(n,e){let t=n;return t=t.replace(/\\n/g,`
|
|
2
|
+
`),e&&(t=t.replace(/\{\{(\w+)\}\}/g,(o,i)=>{let s=e[i];return s!==void 0?String(s):`{{${i}}}`})),t}function I(n,e,t){let o=B(n);o?.onFailure&&console.error(`${ye.failure} ${Q(o.onFailure,t)}`),e&&console.error(` ${e}`)}function K(n,e){if(!Te())return;let t=B(n);t?.onAlreadyDone&&console.log(Q(t.onAlreadyDone,e))}function X(n,e){return{command:n,operation:e}}var f=X("whoami");async function Se(){try{let n=A(),e=W(),t,o;if(n==="oauth"){let s=_();if(!await s.isAuthenticated()){K(f);return}let a=await s.getIdTokenClaims();t=a.email,o=a.sub}else if(e)t=void 0,o=e.accessKeyId;else{K(f);return}let i=[];if(i.push(""),i.push("User Information:"),i.push(` Email: ${t||"N/A"}`),i.push(` User ID: ${o||"N/A"}`),n==="oauth"){let s=await V(),r=u(),{data:a,error:R}=await Ae({config:s});R&&(I(f,R.message),process.exit(1));let m=a?.organizations??[];if(m.length>0){if(i.push(""),i.push(`Organizations (${m.length}):`),m.forEach(l=>{let Z=l.id===r?">":" ";i.push(` ${Z} ${l.name} (${l.id})`)}),r){let l=m.find(z=>z.id===r);l&&(i.push(""),i.push(`Active: ${l.name}`))}}else i.push(""),i.push("Organizations: None")}else i.push(""),i.push("Login method: Access Key Credentials"),i.push(" (Organization listing requires OAuth login: tigris login)");i.push(""),console.log(i.join(`
|
|
3
|
+
`))}catch(n){n instanceof Error?I(f,n.message):I(f),process.exit(1)}}export{Se as default};
|
package/dist/specs.yaml
CHANGED
|
@@ -79,7 +79,7 @@ commands:
|
|
|
79
79
|
#########################
|
|
80
80
|
# configure
|
|
81
81
|
- name: configure
|
|
82
|
-
description: Save credentials permanently. After running this, all commands
|
|
82
|
+
description: Save credentials permanently. After running this, all commands uses these credentials.
|
|
83
83
|
alias: c
|
|
84
84
|
messages:
|
|
85
85
|
onStart: 'Saving credentials...'
|
|
@@ -189,84 +189,6 @@ commands:
|
|
|
189
189
|
alias: b
|
|
190
190
|
required: false
|
|
191
191
|
|
|
192
|
-
# access-keys
|
|
193
|
-
- name: access-keys
|
|
194
|
-
description: Manage access keys
|
|
195
|
-
alias: keys
|
|
196
|
-
operations:
|
|
197
|
-
- name: list
|
|
198
|
-
description: List all access keys
|
|
199
|
-
alias: l
|
|
200
|
-
messages:
|
|
201
|
-
onStart: ''
|
|
202
|
-
onSuccess: ''
|
|
203
|
-
onFailure: 'Failed to list access keys'
|
|
204
|
-
onEmpty: 'No access keys found'
|
|
205
|
-
- name: create
|
|
206
|
-
description: Create a new access key
|
|
207
|
-
alias: c
|
|
208
|
-
messages:
|
|
209
|
-
onStart: 'Creating access key...'
|
|
210
|
-
onSuccess: 'Access key created'
|
|
211
|
-
onFailure: 'Failed to create access key'
|
|
212
|
-
arguments:
|
|
213
|
-
- name: name
|
|
214
|
-
description: Name for the access key
|
|
215
|
-
type: positional
|
|
216
|
-
required: true
|
|
217
|
-
- name: delete
|
|
218
|
-
description: Delete an access key
|
|
219
|
-
alias: d
|
|
220
|
-
messages:
|
|
221
|
-
onStart: 'Deleting access key...'
|
|
222
|
-
onSuccess: 'Access key deleted'
|
|
223
|
-
onFailure: 'Failed to delete access key'
|
|
224
|
-
arguments:
|
|
225
|
-
- name: id
|
|
226
|
-
description: Access key ID
|
|
227
|
-
type: positional
|
|
228
|
-
required: true
|
|
229
|
-
- name: get
|
|
230
|
-
description: Get details of an access key
|
|
231
|
-
alias: g
|
|
232
|
-
messages:
|
|
233
|
-
onStart: ''
|
|
234
|
-
onSuccess: ''
|
|
235
|
-
onFailure: 'Failed to get access key'
|
|
236
|
-
arguments:
|
|
237
|
-
- name: id
|
|
238
|
-
description: Access key ID
|
|
239
|
-
type: positional
|
|
240
|
-
required: true
|
|
241
|
-
- name: assign
|
|
242
|
-
description: Assign bucket roles to an access key
|
|
243
|
-
alias: a
|
|
244
|
-
messages:
|
|
245
|
-
onStart: 'Assigning bucket roles...'
|
|
246
|
-
onSuccess: 'Bucket roles assigned'
|
|
247
|
-
onFailure: 'Failed to assign bucket roles'
|
|
248
|
-
arguments:
|
|
249
|
-
- name: id
|
|
250
|
-
description: Access key ID
|
|
251
|
-
type: positional
|
|
252
|
-
required: true
|
|
253
|
-
- name: bucket
|
|
254
|
-
alias: b
|
|
255
|
-
description: Bucket name (can specify multiple)
|
|
256
|
-
multiple: true
|
|
257
|
-
- name: role
|
|
258
|
-
alias: r
|
|
259
|
-
description: Role to assign (can specify multiple to pair with buckets)
|
|
260
|
-
multiple: true
|
|
261
|
-
options:
|
|
262
|
-
- Editor
|
|
263
|
-
- ReadOnly
|
|
264
|
-
- name: admin
|
|
265
|
-
description: Grant admin access to all buckets in the organization
|
|
266
|
-
type: flag
|
|
267
|
-
- name: revoke-roles
|
|
268
|
-
description: Revoke all bucket roles from the access key
|
|
269
|
-
type: flag
|
|
270
192
|
|
|
271
193
|
#########################
|
|
272
194
|
# Unix style commands
|
|
@@ -426,6 +348,8 @@ commands:
|
|
|
426
348
|
type: positional
|
|
427
349
|
required: true
|
|
428
350
|
description: Name of the organization
|
|
351
|
+
examples:
|
|
352
|
+
- my-organization
|
|
429
353
|
- name: select
|
|
430
354
|
description: Select the organization to use
|
|
431
355
|
alias: s
|
|
@@ -438,6 +362,8 @@ commands:
|
|
|
438
362
|
type: positional
|
|
439
363
|
required: true
|
|
440
364
|
description: Name of the organization
|
|
365
|
+
examples:
|
|
366
|
+
- my-organization
|
|
441
367
|
|
|
442
368
|
#########################
|
|
443
369
|
# Manage buckets
|
|
@@ -464,7 +390,7 @@ commands:
|
|
|
464
390
|
# create
|
|
465
391
|
- name: create
|
|
466
392
|
description: Create bucket
|
|
467
|
-
alias:
|
|
393
|
+
alias: c
|
|
468
394
|
messages:
|
|
469
395
|
onStart: 'Creating bucket...'
|
|
470
396
|
onSuccess: "Bucket '{{name}}' created successfully"
|
|
@@ -474,6 +400,8 @@ commands:
|
|
|
474
400
|
description: Name of the bucket
|
|
475
401
|
type: positional
|
|
476
402
|
required: false
|
|
403
|
+
examples:
|
|
404
|
+
- my-bucket
|
|
477
405
|
- name: access
|
|
478
406
|
description: Access level
|
|
479
407
|
alias: a
|
|
@@ -512,6 +440,8 @@ commands:
|
|
|
512
440
|
description: Name of the bucket
|
|
513
441
|
type: positional
|
|
514
442
|
required: true
|
|
443
|
+
examples:
|
|
444
|
+
- my-bucket
|
|
515
445
|
# delete
|
|
516
446
|
- name: delete
|
|
517
447
|
description: Delete bucket
|
|
@@ -526,6 +456,8 @@ commands:
|
|
|
526
456
|
type: positional
|
|
527
457
|
required: true
|
|
528
458
|
multiple: true
|
|
459
|
+
examples:
|
|
460
|
+
- my-bucket
|
|
529
461
|
# set
|
|
530
462
|
- name: set
|
|
531
463
|
description: Update bucket settings
|
|
@@ -539,6 +471,8 @@ commands:
|
|
|
539
471
|
description: Name of the bucket
|
|
540
472
|
type: positional
|
|
541
473
|
required: true
|
|
474
|
+
examples:
|
|
475
|
+
- my-bucket
|
|
542
476
|
- name: access
|
|
543
477
|
description: Bucket access level
|
|
544
478
|
options: *access_options
|
|
@@ -581,6 +515,8 @@ commands:
|
|
|
581
515
|
description: Name of the source bucket
|
|
582
516
|
type: positional
|
|
583
517
|
required: true
|
|
518
|
+
examples:
|
|
519
|
+
- my-bucket
|
|
584
520
|
- name: format
|
|
585
521
|
description: Output format
|
|
586
522
|
alias: f
|
|
@@ -599,10 +535,14 @@ commands:
|
|
|
599
535
|
description: Name of the source bucket
|
|
600
536
|
type: positional
|
|
601
537
|
required: true
|
|
538
|
+
examples:
|
|
539
|
+
- my-bucket
|
|
602
540
|
- name: fork-name
|
|
603
541
|
description: Name for the new fork
|
|
604
542
|
type: positional
|
|
605
543
|
required: true
|
|
544
|
+
examples:
|
|
545
|
+
- my-fork
|
|
606
546
|
- name: snapshot
|
|
607
547
|
description: Create fork from a specific snapshot
|
|
608
548
|
alias: s
|
|
@@ -628,6 +568,8 @@ commands:
|
|
|
628
568
|
description: Name of the bucket
|
|
629
569
|
type: positional
|
|
630
570
|
required: true
|
|
571
|
+
examples:
|
|
572
|
+
- my-bucket
|
|
631
573
|
- name: format
|
|
632
574
|
description: Output format
|
|
633
575
|
alias: f
|
|
@@ -646,10 +588,14 @@ commands:
|
|
|
646
588
|
description: Name of the bucket
|
|
647
589
|
type: positional
|
|
648
590
|
required: true
|
|
591
|
+
examples:
|
|
592
|
+
- my-bucket
|
|
649
593
|
- name: snapshot-name
|
|
650
594
|
description: Name of the snapshot (optional)
|
|
651
595
|
type: positional
|
|
652
596
|
required: false
|
|
597
|
+
examples:
|
|
598
|
+
- my-snapshot
|
|
653
599
|
|
|
654
600
|
#########################
|
|
655
601
|
# Manage objects
|
|
@@ -672,6 +618,8 @@ commands:
|
|
|
672
618
|
description: Name of the bucket
|
|
673
619
|
type: positional
|
|
674
620
|
required: true
|
|
621
|
+
examples:
|
|
622
|
+
- my-bucket
|
|
675
623
|
- name: prefix
|
|
676
624
|
description: Filter objects by prefix
|
|
677
625
|
alias: p
|
|
@@ -693,10 +641,14 @@ commands:
|
|
|
693
641
|
description: Name of the bucket
|
|
694
642
|
type: positional
|
|
695
643
|
required: true
|
|
644
|
+
examples:
|
|
645
|
+
- my-bucket
|
|
696
646
|
- name: key
|
|
697
647
|
description: Key of the object
|
|
698
648
|
type: positional
|
|
699
649
|
required: true
|
|
650
|
+
examples:
|
|
651
|
+
- my-file.txt
|
|
700
652
|
- name: output
|
|
701
653
|
description: Output file path (if not specified, prints to stdout)
|
|
702
654
|
alias: o
|
|
@@ -717,14 +669,19 @@ commands:
|
|
|
717
669
|
description: Name of the bucket
|
|
718
670
|
type: positional
|
|
719
671
|
required: true
|
|
672
|
+
examples:
|
|
673
|
+
- my-bucket
|
|
720
674
|
- name: key
|
|
721
675
|
description: Key for the object
|
|
722
676
|
type: positional
|
|
723
677
|
required: true
|
|
678
|
+
examples:
|
|
679
|
+
- my-file.txt
|
|
724
680
|
- name: file
|
|
725
681
|
description: Path to the file to upload
|
|
726
682
|
type: positional
|
|
727
|
-
|
|
683
|
+
examples:
|
|
684
|
+
- ./my-file.txt
|
|
728
685
|
- name: access
|
|
729
686
|
description: Access level
|
|
730
687
|
alias: a
|
|
@@ -751,8 +708,101 @@ commands:
|
|
|
751
708
|
description: Name of the bucket
|
|
752
709
|
type: positional
|
|
753
710
|
required: true
|
|
711
|
+
examples:
|
|
712
|
+
- my-bucket
|
|
754
713
|
- name: key
|
|
755
714
|
description: Key of the object (comma separated for multiple)
|
|
756
715
|
type: positional
|
|
757
716
|
required: true
|
|
758
717
|
multiple: true
|
|
718
|
+
examples:
|
|
719
|
+
- my-file.txt
|
|
720
|
+
|
|
721
|
+
#########################
|
|
722
|
+
# Manage access keys
|
|
723
|
+
#########################
|
|
724
|
+
- name: access-keys
|
|
725
|
+
description: Manage access keys
|
|
726
|
+
alias: keys
|
|
727
|
+
operations:
|
|
728
|
+
- name: list
|
|
729
|
+
description: List all access keys
|
|
730
|
+
alias: l
|
|
731
|
+
messages:
|
|
732
|
+
onStart: ''
|
|
733
|
+
onSuccess: ''
|
|
734
|
+
onFailure: 'Failed to list access keys'
|
|
735
|
+
onEmpty: 'No access keys found'
|
|
736
|
+
- name: create
|
|
737
|
+
description: Create a new access key
|
|
738
|
+
alias: c
|
|
739
|
+
messages:
|
|
740
|
+
onStart: 'Creating access key...'
|
|
741
|
+
onSuccess: 'Access key created'
|
|
742
|
+
onFailure: 'Failed to create access key'
|
|
743
|
+
arguments:
|
|
744
|
+
- name: name
|
|
745
|
+
description: Name for the access key
|
|
746
|
+
type: positional
|
|
747
|
+
required: true
|
|
748
|
+
examples:
|
|
749
|
+
- my-key
|
|
750
|
+
- name: delete
|
|
751
|
+
description: Delete an access key
|
|
752
|
+
alias: d
|
|
753
|
+
messages:
|
|
754
|
+
onStart: 'Deleting access key...'
|
|
755
|
+
onSuccess: 'Access key deleted'
|
|
756
|
+
onFailure: 'Failed to delete access key'
|
|
757
|
+
arguments:
|
|
758
|
+
- name: id
|
|
759
|
+
description: Access key ID
|
|
760
|
+
type: positional
|
|
761
|
+
required: true
|
|
762
|
+
examples:
|
|
763
|
+
- tid_AaBbCcDdEeFf
|
|
764
|
+
- name: get
|
|
765
|
+
description: Get details of an access key
|
|
766
|
+
alias: g
|
|
767
|
+
messages:
|
|
768
|
+
onStart: ''
|
|
769
|
+
onSuccess: ''
|
|
770
|
+
onFailure: 'Failed to get access key'
|
|
771
|
+
arguments:
|
|
772
|
+
- name: id
|
|
773
|
+
description: Access key ID
|
|
774
|
+
type: positional
|
|
775
|
+
required: true
|
|
776
|
+
examples:
|
|
777
|
+
- tid_AaBbCcDdEeFf
|
|
778
|
+
- name: assign
|
|
779
|
+
description: Assign bucket roles to an access key
|
|
780
|
+
alias: a
|
|
781
|
+
messages:
|
|
782
|
+
onStart: 'Assigning bucket roles...'
|
|
783
|
+
onSuccess: 'Bucket roles assigned'
|
|
784
|
+
onFailure: 'Failed to assign bucket roles'
|
|
785
|
+
arguments:
|
|
786
|
+
- name: id
|
|
787
|
+
description: Access key ID
|
|
788
|
+
type: positional
|
|
789
|
+
required: true
|
|
790
|
+
examples:
|
|
791
|
+
- tid_AaBbCcDdEeFf
|
|
792
|
+
- name: bucket
|
|
793
|
+
alias: b
|
|
794
|
+
description: Bucket name (can specify multiple)
|
|
795
|
+
multiple: true
|
|
796
|
+
- name: role
|
|
797
|
+
alias: r
|
|
798
|
+
description: Role to assign (can specify multiple to pair with buckets)
|
|
799
|
+
multiple: true
|
|
800
|
+
options:
|
|
801
|
+
- Editor
|
|
802
|
+
- ReadOnly
|
|
803
|
+
- name: admin
|
|
804
|
+
description: Grant admin access to all buckets in the organization
|
|
805
|
+
type: flag
|
|
806
|
+
- name: revoke-roles
|
|
807
|
+
description: Revoke all bucket roles from the access key
|
|
808
|
+
type: flag
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tigrisdata/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Command line interface for Tigris object storage",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -78,8 +78,10 @@
|
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@aws-sdk/client-s3": "^3.908.0",
|
|
81
|
+
"@aws-sdk/credential-providers": "^3.981.0",
|
|
82
|
+
"@smithy/shared-ini-file-loader": "^4.4.3",
|
|
81
83
|
"@tigrisdata/iam": "^1.1.0",
|
|
82
|
-
"@tigrisdata/storage": "^2.12.
|
|
84
|
+
"@tigrisdata/storage": "^2.12.2",
|
|
83
85
|
"axios": "^1.12.2",
|
|
84
86
|
"commander": "^11.0.0",
|
|
85
87
|
"enquirer": "^2.4.1",
|