This commit is contained in:
2022-12-29 01:05:23 +00:00
parent b02a73118e
commit 614cefd627
3 changed files with 29 additions and 6 deletions

View File

@@ -171,6 +171,7 @@ namespace Sockeye.Biz
#region CUSTOMERS #region CUSTOMERS
log.LogInformation("RFImport customers"); log.LogInformation("RFImport customers");
res = await client.GetAsync($"{URL_ROCKFISH}api/customer/list"); res = await client.GetAsync($"{URL_ROCKFISH}api/customer/list");
responseText = await res.Content.ReadAsStringAsync(); responseText = await res.Content.ReadAsStringAsync();
var jaCustomerList = JArray.Parse(responseText); var jaCustomerList = JArray.Parse(responseText);
@@ -408,6 +409,7 @@ namespace Sockeye.Biz
log.LogInformation("RFImport Licenses"); log.LogInformation("RFImport Licenses");
{ {
res = await client.GetAsync($"{URL_ROCKFISH}api/license/list"); res = await client.GetAsync($"{URL_ROCKFISH}api/license/list");
responseText = await res.Content.ReadAsStringAsync(); responseText = await res.Content.ReadAsStringAsync();
var jaLicenseList = JArray.Parse(responseText); var jaLicenseList = JArray.Parse(responseText);
@@ -419,7 +421,7 @@ namespace Sockeye.Biz
res = await client.GetAsync($"{URL_ROCKFISH}api/license/{jLicenseListItem["id"].Value<long>()}"); res = await client.GetAsync($"{URL_ROCKFISH}api/license/{jLicenseListItem["id"].Value<long>()}");
responseText = await res.Content.ReadAsStringAsync(); responseText = await res.Content.ReadAsStringAsync();
var jLicense = JObject.Parse(responseText); var jLicense = JObject.Parse(responseText);
// log.LogInformation($"Importing license:{responseText}"); // log.LogInformation($"Importing license:{responseText}");
/* /*
{"regTo":"PDI Technologies","customerName":"PDI Technologies","dtcreated":1672261044,"email":"jberkel@pdisoftware.com","code":"na","fetched":true,"dtfetched":1672262347,"fetchFrom":null, {"regTo":"PDI Technologies","customerName":"PDI Technologies","dtcreated":1672261044,"email":"jberkel@pdisoftware.com","code":"na","fetched":true,"dtfetched":1672262347,"fetchFrom":null,
"key":"[KEY\n{\n \"Key\": {\n \"LicenseFormat\": \"8\",\n \"Id\": \"1672261044\",\n \"RegisteredTo\": \"PDI Technologies\",\n \"DBID\": \"R6U37uNUN2hSQideG6Gg+MqoQY8vuUeyHFI6Kv7VDsE=\",\n \"Perpetual\": true,\n \"LicenseExpiration\": \"5555-01-01T00:00:00\",\n \"MaintenanceExpiration\": \"2023-12-28T00:00:00\",\n \"Features\": [\n {\n \"Name\": \"ActiveInternalUsers\",\n \"Count\": 5\n }\n ]\n }\n}\nKEY]\n[SIGNATURE\nkzVs8GH0MSIfsR7ZYQ5x+5wdVDJqpfOYvTfBCx32Vs+zqP7h89uUKI17jTx5rMvkOYX40GyJt0pTWOzltljzf+MaoTzoSvTsSPkWtdVWv8ZGOXUUdaZhzMoTJGxTg0JHka/8S5tLkTiuct3x+voiLAKXuFCp9TSZo4+UnejB6U2Bp6MfdZxLtKVZ/1RLu/h4SnP8ZbczuwbQReB1z4k4IRwjh5GHnUUm6YqZg/04m1X9FEeKQZQfGZk/qZ788jONbLQb4CLnq0/ZmIteeocDDBz59TYaC9BHwHp73y8jyPfEugVfyH2AE0J8ZILiFiozYQ7meP5X4ZOmd1nhTA8MkA==\nSIGNATURE]\n" "key":"[KEY\n{\n \"Key\": {\n \"LicenseFormat\": \"8\",\n \"Id\": \"1672261044\",\n \"RegisteredTo\": \"PDI Technologies\",\n \"DBID\": \"R6U37uNUN2hSQideG6Gg+MqoQY8vuUeyHFI6Kv7VDsE=\",\n \"Perpetual\": true,\n \"LicenseExpiration\": \"5555-01-01T00:00:00\",\n \"MaintenanceExpiration\": \"2023-12-28T00:00:00\",\n \"Features\": [\n {\n \"Name\": \"ActiveInternalUsers\",\n \"Count\": 5\n }\n ]\n }\n}\nKEY]\n[SIGNATURE\nkzVs8GH0MSIfsR7ZYQ5x+5wdVDJqpfOYvTfBCx32Vs+zqP7h89uUKI17jTx5rMvkOYX40GyJt0pTWOzltljzf+MaoTzoSvTsSPkWtdVWv8ZGOXUUdaZhzMoTJGxTg0JHka/8S5tLkTiuct3x+voiLAKXuFCp9TSZo4+UnejB6U2Bp6MfdZxLtKVZ/1RLu/h4SnP8ZbczuwbQReB1z4k4IRwjh5GHnUUm6YqZg/04m1X9FEeKQZQfGZk/qZ788jONbLQb4CLnq0/ZmIteeocDDBz59TYaC9BHwHp73y8jyPfEugVfyH2AE0J8ZILiFiozYQ7meP5X4ZOmd1nhTA8MkA==\nSIGNATURE]\n"
@@ -436,6 +438,8 @@ namespace Sockeye.Biz
if (cust != null) if (cust != null)
l.CustomerId = cust.Id; l.CustomerId = cust.Id;
var KeyText = jLicense["key"].Value<string>(); var KeyText = jLicense["key"].Value<string>();
if (KeyText.Contains("AyaNovaLicenseKey")) if (KeyText.Contains("AyaNovaLicenseKey"))
{ {
@@ -496,6 +500,25 @@ namespace Sockeye.Biz
l.FetchCode = jLicense["code"].Value<string>(); l.FetchCode = jLicense["code"].Value<string>();
l.Tags.Add("v7"); l.Tags.Add("v7");
} }
else if (KeyText.Contains("AyaNovaLicenseKey"))
{
/*
"[KEY\n{\n \"AyaNovaLiteLicenseKey\": {\n \"SchemaVersion\": \"7\",\n \"Id\": \"1648506791\",\n \"Created\": \"2022-03-28T15:33:11.6010225-07:00\",\n
\"Sub\": \"true\",\n \"RegisteredTo\": \"Duncan Electric\",\n \"EmailAddress\": \"sandrajod@att.net\",\n
\"FetchCode\": \"hGAmScqYcU\",\n \"Source\": \"5246494431\",\n \"InstallableUntil\": \"2023-03-28T15:33:11.6009851-07:00\",\n
\"TotalScheduleableUsers\": \"1\",\n \"Expires\": \"2023-03-29T00:00:00\",\n \"RequestedTrial\": \"False\",\n \"Plugins\": {\n
\"Plugin\": []\n }\n }\n}\nKEY]\n
[SIGNATURE\nKuOF/SpBL1d8AFebvm2lipmKeGdbR6WzbhN68fun+ffVGRjXNX1jWI3rbf9P/shs2/M8gHqW/B7T0vVovGqosmNsGtvaYo30TKlZj9Eicr2+zDf7ojwZiBCeEnFzXr9+7aZrsZSvN20Pqof0xf/J4BVp1T66ecuZywMzH0NGsXXZtXhWYhGvLAZAR1X5/j5gqysSdysmV9j8Euz91zs/BRyfdU0uwwrdQzrJzI4V1MFl+/mIkhMUNcJ5bzjisWS2xeyNYCYnGpMF5oaGPaIcEtmTAdf5fPNNvw3sNhPaZgwlzN8FjfK6T0VgS19PcHCMOA1bTAiLLFNk6wkcjGp2Cw==\nSIGNATURE]\n"
*/
string keyNoWS = System.Text.RegularExpressions.Regex.Replace(StringUtil.Extract(KeyText, "[KEY", "KEY]").Trim(), "(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+", "$1");
var jKey = JObject.Parse(keyNoWS);
l.LicenseExpire = DateTime.MaxValue.ToUniversalTime();
l.MaintenanceExpire = jKey["AyaNovaLiteLicenseKey"]["Expires"].Value<DateTime>().ToUniversalTime();
l.FetchCode = jLicense["code"].Value<string>();
l.Tags.Add("v7");
l.Tags.Add("lite");
}
else else
{ {
//RAVEN KEY //RAVEN KEY

View File

@@ -16,7 +16,7 @@ namespace Sockeye.Models
public uint Concurrency { get; set; } public uint Concurrency { get; set; }
public DateTime Created { get; set; } public DateTime Created { get; set; }
public long CustomerId { get; set; } public long? CustomerId { get; set; }
[NotMapped] [NotMapped]
public string CustomerViz { get; set; } public string CustomerViz { get; set; }
public string RegTo { get; set; } public string RegTo { get; set; }

View File

@@ -24,14 +24,14 @@ namespace Sockeye.Util
internal const long EXPECTED_COLUMN_COUNT = 498; internal const long EXPECTED_COLUMN_COUNT = 498;
internal const long EXPECTED_INDEX_COUNT = 74; internal const long EXPECTED_INDEX_COUNT = 74;
internal const long EXPECTED_CHECK_CONSTRAINTS = 239; internal const long EXPECTED_CHECK_CONSTRAINTS = 238;
internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 32; internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 32;
internal const long EXPECTED_VIEWS = 0; internal const long EXPECTED_VIEWS = 0;
internal const long EXPECTED_ROUTINES = 2; internal const long EXPECTED_ROUTINES = 2;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!! //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!!
///////////////////////////////////////// (C498:I74:CC239:FC32:V0:R2) ///////////////////////////////////////// (C498:I74:CC238:FC32:V0:R2)
/* /*
@@ -875,7 +875,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
LogUpdateMessage(log); LogUpdateMessage(log);
await ExecQueryAsync("CREATE TABLE alicense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created TIMESTAMPTZ NOT NULL, " await ExecQueryAsync("CREATE TABLE alicense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created TIMESTAMPTZ NOT NULL, "
+ "customerid BIGINT NOT NULL REFERENCES acustomer(id), regto TEXT NOT NULL, key TEXT NOT NULL, fetchcode TEXT, fetchemail TEXT, " + "customerid BIGINT REFERENCES acustomer(id), regto TEXT NOT NULL, key TEXT NOT NULL, fetchcode TEXT, fetchemail TEXT, "
+ "fetchedon TIMESTAMPTZ, dbid TEXT, licenseexpire TIMESTAMPTZ, maintenanceexpire TIMESTAMPTZ NOT NULL, " + "fetchedon TIMESTAMPTZ, dbid TEXT, licenseexpire TIMESTAMPTZ, maintenanceexpire TIMESTAMPTZ NOT NULL, "
+ "wiki TEXT, tags VARCHAR(255) ARRAY )"); + "wiki TEXT, tags VARCHAR(255) ARRAY )");