oak-general-business/lib/oak-app-domain/OauthTokens/Storage.js

54 lines
1.2 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
const action_1 = require("oak-domain/lib/actions/action");
exports.desc = {
attributes: {
accessToken: {
notNull: true,
type: "varchar",
params: {
length: 256
}
},
refreshToken: {
notNull: true,
type: "varchar",
params: {
length: 256
}
},
application: {
notNull: true,
type: "object"
},
userId: {
notNull: true,
type: "ref",
ref: "user"
},
codeId: {
notNull: true,
type: "ref",
ref: "oauthAuthorizationCodes"
},
accessExpiresAt: {
notNull: true,
type: "datetime"
},
refreshExpiresAt: {
notNull: true,
type: "datetime"
},
revokedAt: {
type: "datetime"
},
// 审计相关,需要手动更新
lastUsedAt: {
type: "datetime"
}
},
actionType: "crud",
actions: action_1.genericActions
};