Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@textile/grpc-authentication

Package Overview
Dependencies
Maintainers
5
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@textile/grpc-authentication - npm Package Compare versions

Comparing version 0.1.4 to 0.2.0-alpha.0

28

dist/index.d.ts

@@ -5,2 +5,20 @@ import { GrpcConnection } from '@textile/grpc-connection';

/**
* Set the options for authenticating with an API key
*/
export interface WithKeyInfoOptions extends WithUserAuthOptions {
date?: Date;
}
/**
* Set the options for authenticating with a user auth
*/
export interface WithUserAuthOptions extends CopyAuthOptions {
host?: string;
}
/**
* Set additional options when copying authentication
*/
export interface CopyAuthOptions {
debug?: boolean;
}
/**
* Not for external use. Defines the authorization, authentication, and

@@ -26,3 +44,3 @@ * API scoping methods used by gRPC API client classes such as Users and Buckets.

* Copy an authenticated Users api instance to Buckets.
* ```tyepscript
* ```typescript
* import { Buckets, Users } from '@textile/hub'

@@ -38,3 +56,3 @@ *

* Copy an authenticated Buckets api instance to Users.
* ```tyepscript
* ```typescript
* import { Buckets, Users } from '@textile/hub'

@@ -48,3 +66,3 @@ *

*/
static copyAuth(auth: GrpcAuthentication, debug?: boolean): GrpcAuthentication;
static copyAuth(auth: GrpcAuthentication, options?: CopyAuthOptions): GrpcAuthentication;
/**

@@ -65,3 +83,3 @@ * Creates a new API client instance for accessing the gRPC API

*/
static withUserAuth(auth: UserAuth | (() => Promise<UserAuth>), host?: string, debug?: boolean): GrpcAuthentication;
static withUserAuth(auth: UserAuth | (() => Promise<UserAuth>), options?: WithUserAuthOptions): GrpcAuthentication;
/**

@@ -87,3 +105,3 @@ * Creates a new API client instance for accessing the gRPC API

*/
static withKeyInfo(key: KeyInfo, host?: string, debug?: boolean): Promise<GrpcAuthentication>;
static withKeyInfo(key: KeyInfo, options?: WithKeyInfoOptions): Promise<GrpcAuthentication>;
/**

@@ -90,0 +108,0 @@ * Scope future API calls to a specific thread.

24

dist/index.js

@@ -37,3 +37,3 @@ "use strict";

* Copy an authenticated Users api instance to Buckets.
* ```tyepscript
* ```typescript
* import { Buckets, Users } from '@textile/hub'

@@ -49,3 +49,3 @@ *

* Copy an authenticated Buckets api instance to Users.
* ```tyepscript
* ```typescript
* import { Buckets, Users } from '@textile/hub'

@@ -59,4 +59,4 @@ *

*/
static copyAuth(auth, debug = false) {
return new GrpcAuthentication(auth.context, debug);
static copyAuth(auth, options = {}) {
return new GrpcAuthentication(auth.context, options.debug);
}

@@ -78,5 +78,7 @@ /**

*/
static withUserAuth(auth, host = context_1.defaultHost, debug = false) {
const context = typeof auth === 'object' ? context_1.Context.fromUserAuth(auth, host) : context_1.Context.fromUserAuthCallback(auth, host);
return new GrpcAuthentication(context, debug);
static withUserAuth(auth, options = {}) {
const context = typeof auth === 'object'
? context_1.Context.fromUserAuth(auth, options.host)
: context_1.Context.fromUserAuthCallback(auth, options.host);
return new GrpcAuthentication(context, options.debug);
}

@@ -103,7 +105,7 @@ /**

*/
static withKeyInfo(key, host = context_1.defaultHost, debug = false) {
static withKeyInfo(key, options = {}) {
return __awaiter(this, void 0, void 0, function* () {
const context = new context_1.Context(host);
yield context.withKeyInfo(key);
return new GrpcAuthentication(context, debug);
const context = new context_1.Context(options.host);
yield context.withKeyInfo(key, options.date);
return new GrpcAuthentication(context, options.debug);
});

@@ -110,0 +112,0 @@ }

{
"name": "@textile/grpc-authentication",
"version": "0.1.4",
"version": "0.2.0-alpha.0",
"description": "web-gRPC state manager for grpc-connection.",

@@ -34,3 +34,3 @@ "main": "dist/index",

"@textile/grpc-connection": "^0.1.2",
"@textile/hub-threads-client": "^0.4.4",
"@textile/hub-threads-client": "^0.5.0-alpha.0",
"@textile/security": "^0.2.6"

@@ -53,3 +53,3 @@ },

],
"gitHead": "5e84b1428117c4fdd2cdfd57249550ce1c03fc87"
"gitHead": "a191c5fe51715865640826ee6ad3c8acb6c631ad"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc