mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 12:38:36 +00:00
Move secret versioning and snapshot functionality into ee and begin license scoping
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Class to handle Enterprise Edition license actions
|
||||
*/
|
||||
class EELicenseService {
|
||||
/**
|
||||
* Check if license key [licenseKey] corresponds to a
|
||||
* valid Infisical Enterprise Edition license.
|
||||
* @param {Object} obj
|
||||
* @param {Object} obj.licenseKey
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
static async checkLicense({
|
||||
licenseKey
|
||||
}: {
|
||||
licenseKey: string;
|
||||
}) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export default EELicenseService;
|
||||
@@ -0,0 +1,29 @@
|
||||
import { takeSecretSnapshotHelper } from '../helpers/secret';
|
||||
import EELicenseService from './EELicenseService';
|
||||
|
||||
/**
|
||||
* Class to handle Enterprise Edition secret actions
|
||||
*/
|
||||
class EESecretService {
|
||||
|
||||
/**
|
||||
* Save a copy of the current state of secrets in workspace with id
|
||||
* [workspaceId] under a new snapshot with incremented version under the
|
||||
* SecretSnapshot collection.
|
||||
* Requires a valid license key [licenseKey]
|
||||
* @param {Object} obj
|
||||
* @param {String} obj.workspaceId
|
||||
*/
|
||||
static async takeSecretSnapshot({
|
||||
licenseKey,
|
||||
workspaceId
|
||||
}: {
|
||||
licenseKey: string;
|
||||
workspaceId: string;
|
||||
}) {
|
||||
EELicenseService.checkLicense({ licenseKey });
|
||||
await takeSecretSnapshotHelper({ workspaceId });
|
||||
}
|
||||
}
|
||||
|
||||
export default EESecretService;
|
||||
@@ -0,0 +1,7 @@
|
||||
import EELicenseService from "./EELicenseService";
|
||||
import EESecretService from "./EESecretService";
|
||||
|
||||
export {
|
||||
EELicenseService,
|
||||
EESecretService
|
||||
}
|
||||
Reference in New Issue
Block a user