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

@lemoncloud/codes-backend-api

Package Overview
Dependencies
Maintainers
0
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lemoncloud/codes-backend-api - npm Package Compare versions

Comparing version 0.24.703 to 0.24.710

dist/service/backend-session.d.ts

2

dist/cores/types.d.ts

@@ -18,3 +18,3 @@ /**

*/
export interface ListResult<T, R = string> {
export interface ListResult<T, R = any> {
/**

@@ -21,0 +21,0 @@ * total searched count

@@ -117,2 +117,4 @@ /**

roles?: UserRole[];
/** user code (= encode(id)) */
code?: string;
/** name of model */

@@ -122,2 +124,6 @@ name?: string;

nick?: string;
/** (optional) photo of user */
photo?: string;
/** (optional) user phone */
phone?: string;
/** (optional) the alias-id linked (valid only if stereo is alias) */

@@ -130,7 +136,11 @@ aliasId?: string;

/** (optional) the login-id */
loginType?: string;
/** (optional) the login-id */
loginId?: string;
/** (optional) the login-pw (encoded) */
loginPw?: string;
/** (optional) user phone */
phone?: string;
/** (optional) the final iid from IAM */
identityId?: string;
/** (optional) the last auth-id */
lastAuthId?: string;
/**

@@ -137,0 +147,0 @@ * (optional) extended alias infor if stereo == '#alias'

@@ -11,8 +11,18 @@ /**

import { SimpleSet } from 'lemon-model';
import * as $model from 'lemon-model';
import { UserModel, SiteModel, RoleModel } from './backend-model';
import { KeyConfig, SessionToken } from './oauth-types';
import { KeyConfig } from './oauth-types';
import { UserView } from '../view/types';
import { SessionToken } from './backend-session';
import * as $cognitos from '@lemoncloud/lemon-cognitos-api';
import * as $model from 'lemon-model';
export { SimpleSet, SessionToken };
/**
* type: `OpenIdTokenParams`
*/
export declare type OpenIdTokenParams = $cognitos.OpenIdTokenParams;
/**
* type: `OpenIdTokenResult`
*/
export declare type OpenIdTokenResult = $cognitos.OpenIdTokenResult;
/**
* type: `GitHubType`

@@ -83,2 +93,4 @@ * - 링크된 깃허브 정보를 담기위한 목적으로 사용됨.

'#alias': string;
/** (internal) alias by code */
'#code': string;
/** admin user */

@@ -108,2 +120,3 @@ admin: string;

'': string;
'#': string;
};

@@ -121,2 +134,4 @@ /**

email: string;
/** use social */
social: string;
/** (internal) lookup by identity-id */

@@ -123,0 +138,0 @@ iid: string;

@@ -10,6 +10,5 @@ /**

*/
import { NextIdentity } from 'lemon-model';
import { AccessView, AuthView, IdentityView, OAuthRefreshBody, OAuthTokenBody, OAuthTokenResult, SimpleSet } from '@lemoncloud/lemon-accounts-api';
import { SimpleSet } from 'lemon-model';
import { AccessView, AuthView, IdentityView, OAuthTokenBody } from '@lemoncloud/lemon-accounts-api';
import { SiteView } from '../view/types';
export { OAuthTokenResult };
/**

@@ -37,68 +36,86 @@ * AWS Credentials to use

/**
* environment name
* token-result from final authentication.
*/
export declare class AccountEnviron {
static readonly COGNITO_POOL_ID = "MY_COGNITO_POOL_ID";
static readonly IDENTITY_POOL_ID = "MY_IDENTITY_POOL_ID";
static readonly IDENTITY_LOGIN_NAME = "MY_IDENTITY_LOGIN_NAME";
}
/**
* type: `SessionToken`
* - 세션토큰(= JWT(identityToken))으로, `/reg-dev`시 액세스토큰과 함께 발급됨 (약 1일동안 유효함)
* - `backend-api`에서 조직/그룹/사용자에 맞게 재설정됨!
* - `backend-api`에서 슈퍼타입을 정의하고, 다른곳에서는 이것을 import 하여 이용함.
* - 세션토큰 검사는 `proxy.getCurrenSession()` 이용하기
*/
export interface SessionToken extends NextIdentity<any> {
export interface OAuthTokenResult {
/**
* site-id (= id in `SiteModel(사이트/아파트)`)
* - `#` 일경우, 특정 site에 엮이지 않음 (무시됨)
*
* @see SiteModel
* error message if failed
*/
sid: string;
error?: string;
/**
* group-id (= id in `GroupModel(그룹)`)
* - `group`은 `user`를 물리적 구분으로 나눠서 생각해볼때 이용가능함.
*
* @see GroupModel
* auth-id via origin authorize request.
*/
gid: string;
authId?: string;
/**
* user-id (= id in `UserModel(이용자)`)
* - `account`는 인증(로그인)처리와 관련된 것으로, 특정 `user`가 이 인증을 사용하여 특정 사이트에서 역활(role) 수행을함.
* - 여기는 `backend-api`에서 관리되는 `user-model`의 모델ID.
*
* @see UserModel
* account-id if logged successfully.
*/
uid: string;
accountId?: string;
/**
* list of roles (like `user`, `admin`, `super`)
* identity-pool-id of STS
*/
roles: string[];
identityPoolId?: string;
/**
* (optional) internal `identity-id` (= delegated identity)
* - `.identityId` 는 cognito 인증을 통해서, 현재 인증된 `identity-id`를 알 수 있음
* - 다만, 해당 Account가 `delegated-id`가 있을 경우, 여기에 위임된 id 가 들어감.
* identity-id of authorized.
*/
identityId?: string;
/**
* identity-token
*/
identityToken?: string;
/**
* access credentials to use.
*/
credential?: AWSCredentials;
/**
* (optional) agreement timestamp.
*/
agreedAt?: number;
/**
* (optional) expired timestamp.
*/
expiredAt?: number;
/** (optional) the current site-infor */
$site?: SiteView;
}
/**
* body of `/oauth/refresh`
*/
export interface OAuthRefreshBody {
/**
* the current timestamp(ISO) of client
*
* @see NextIdentityCognito
* ```ts
* const time = 1678793532758;
* const current = new Date(time).toISOString();
* expect(current).toEqual('2023-03-14T11:32:12.758Z');
* ```
*/
iid?: string;
current?: string;
/**
* service-name of issuer
* ex) `ssocio2-backend-api`
* the calclated signature string
*
* **[WORKFLOW]**
* 1. (pre) save identity-token in local-storage when issuing token.
* 2. load auth-id, account-id, identity-token, identity-id.
* 3. set current := new Date().toISOString()
* 4. set signature := Signature([current, account-id, identity-id, identity-token, user-agent].join('&'), auth-id)
* 5. post /refresh with current, auth-id, signature.
* 6. fails if time-diff is 30mic, or wrong signature.
*
* ```ts
* const hmac = (data: string, sig: string) => this.hmac(data, sig);
* const data = [current, accountId, identityId, identityToken, userAgent].join('&');
* const signature = hmac(hmac(hmac(data, authId), accountId), identityId);
* ```
*/
iss?: string;
/** Site Extensions */
Site?: {
/** site-code */
code?: string;
};
/** User Extensions */
User?: {
/** user-name */
name?: string;
};
signature?: string;
}
/**
* environment name
*/
export declare class AccountEnviron {
static readonly COGNITO_POOL_ID = "MY_COGNITO_POOL_ID";
static readonly IDENTITY_POOL_ID = "MY_IDENTITY_POOL_ID";
static readonly IDENTITY_LOGIN_NAME = "MY_IDENTITY_LOGIN_NAME";
}
/**
* type: `Domain$`

@@ -105,0 +122,0 @@ */

{
"name": "@lemoncloud/codes-backend-api",
"version": "0.24.703",
"version": "0.24.710",
"description": "eureka codes backend management api",

@@ -5,0 +5,0 @@ "types": "dist/view/types.d.ts",

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