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

52 lines
1.2 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.desc = void 0;
const Action_1 = require("./Action");
exports.desc = {
attributes: {
userId: {
notNull: true,
type: "ref",
ref: "user"
},
applicationId: {
notNull: true,
type: "ref",
ref: "oauthApplication"
},
authorizedAt: {
notNull: true,
type: "datetime"
},
codeId: {
type: "ref",
ref: "oauthAuthorizationCode"
},
tokenId: {
type: "ref",
ref: "oauthToken"
},
usageState: {
type: "enum",
enumeration: ["granted", "denied", "revoked"]
}
},
actionType: "crud",
actions: Action_1.actions,
indexes: [
// 根据授权码查询唯一记录
{
name: 'idx_code_id',
attributes: [
{
name: "codeId",
direction: 'ASC',
}
],
config: {
unique: true,
}
}
]
};