37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import { String, Int, Text, Image, Datetime } from 'oak-domain/lib/types/DataType';
|
|
import { Schema as User } from './User';
|
|
import { Schema as Token } from './Token';
|
|
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
|
import { AbleAction, AbleState, makeAbleActionDef } from 'oak-domain/lib/actions/action';
|
|
import { ActionDef, Index } from 'oak-domain/lib/types';
|
|
import { EntityDesc } from 'oak-domain/lib/types/EntityDesc';
|
|
import { Schema as System } from './System';
|
|
import { Schema as OauthApplication } from './OauthApplication';
|
|
import { Schema as OauthToken } from './OauthToken';
|
|
|
|
// oauth 提供方用户授权记录
|
|
// 用户授权记录表 OAuth Authorization Records
|
|
export interface Schema extends EntityShape {
|
|
user: User;
|
|
application: OauthApplication;
|
|
authorizedAt: Datetime; // 用户首次授权时间
|
|
token: OauthToken; // 关联的令牌
|
|
};
|
|
|
|
export const entityDesc: EntityDesc<Schema, '', '', {
|
|
}> = {
|
|
locales: {
|
|
zh_CN: {
|
|
// 用户可以查看和管理已授权的应用
|
|
name: '用户授权记录',
|
|
attr: {
|
|
user: '用户',
|
|
application: 'Oauth应用',
|
|
authorizedAt: '首次授权时间',
|
|
token: '关联的令牌',
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|