diff --git a/Cli/Commands.cs b/Cli/Commands.cs index a0f44ad..65ca381 100644 --- a/Cli/Commands.cs +++ b/Cli/Commands.cs @@ -307,10 +307,17 @@ public async Task Run(InputManager inputManager) else { Console.Write(StateContext.GetPrompt() + "> "); - command = await inputManager.ReadLine(new ReadLineParameters + try { - IsHistory = true - }); + command = await inputManager.ReadLine(new ReadLineParameters + { + IsHistory = true + }); + } + catch (KeyboardInterrupt) + { + command = ""; + } } if (string.IsNullOrEmpty(command)) continue; diff --git a/Commander/enterprise/EnterpriseCommands.cs b/Commander/enterprise/EnterpriseCommands.cs index 225fdf3..b3b96af 100644 --- a/Commander/enterprise/EnterpriseCommands.cs +++ b/Commander/enterprise/EnterpriseCommands.cs @@ -15,8 +15,10 @@ using KeeperSecurity.Authentication; using KeeperSecurity.Commands; using KeeperSecurity.Enterprise; +using KeeperSecurity.Enterprise.AuditLogCommands; using KeeperSecurity.Utils; using Org.BouncyCastle.Crypto.Parameters; +using static KeeperSecurity.Enterprise.AuditLogExtensions; using EnterpriseData = KeeperSecurity.Enterprise.EnterpriseData; namespace Commander @@ -114,7 +116,7 @@ internal static void AppendEnterpriseCommands(this IEnterpriseContext context, C cli.CommandAliases["er"] = "enterprise-role"; cli.CommandAliases["ed"] = "enterprise-device"; - + if (context.Enterprise.EcPrivateKey == null) { cli.Commands.Add("enterprise-add-key", @@ -250,29 +252,29 @@ public static async Task EnterpriseNodeCommand(this EnterpriseData enterpriseDat } case "update": - if (!string.IsNullOrEmpty(arguments.Name)) - { - node.DisplayName = arguments.Name; - } - await enterpriseData.UpdateNode(node, parentNode); - Console.WriteLine($"Node \"{node.DisplayName}\" updated."); - if (arguments.RestrictVisibility) - { - await enterpriseData.SetRestrictVisibility(node.Id); - await enterpriseData.Enterprise.Load(); - Console.WriteLine($"Node Isolation: {(node.RestrictVisibility ? "ON" : "OFF")}"); - } + if (!string.IsNullOrEmpty(arguments.Name)) + { + node.DisplayName = arguments.Name; + } + await enterpriseData.UpdateNode(node, parentNode); + Console.WriteLine($"Node \"{node.DisplayName}\" updated."); + if (arguments.RestrictVisibility) + { + await enterpriseData.SetRestrictVisibility(node.Id); + await enterpriseData.Enterprise.Load(); + Console.WriteLine($"Node Isolation: {(node.RestrictVisibility ? "ON" : "OFF")}"); + } - break; + break; case "delete": - await enterpriseData.DeleteNode(node.Id); - Console.WriteLine($"Node \"{node.DisplayName}\" deleted."); - break; + await enterpriseData.DeleteNode(node.Id); + Console.WriteLine($"Node \"{node.DisplayName}\" deleted."); + break; default: - Console.WriteLine($"Unsupported command \"{arguments.Command}\": available commands \"tree\", \"add\", \"update\", \"delete\""); - break; + Console.WriteLine($"Unsupported command \"{arguments.Command}\": available commands \"tree\", \"add\", \"update\", \"delete\""); + break; } } await enterpriseData.Enterprise.Load(); @@ -331,7 +333,7 @@ public static async Task EnterpriseUserCommand(this IEnterpriseContext context, return; } - if (string.IsNullOrEmpty(arguments.User)) + if (string.IsNullOrEmpty(arguments.User)) { Console.WriteLine("User parameter cannot be empty"); return; @@ -850,7 +852,7 @@ public static async Task EnterpriseRoleCommand(this RoleDataManagement roleData, return; } - if (string.CompareOrdinal(arguments.Command, "delete") == 0) + if (string.CompareOrdinal(arguments.Command, "delete") == 0) { await roleData.DeleteRole(role.Id); return; @@ -858,7 +860,7 @@ public static async Task EnterpriseRoleCommand(this RoleDataManagement roleData, var cmds = new HashSet(StringComparer.InvariantCultureIgnoreCase); cmds.UnionWith(new[] { "add-members", "remove-members" }); - if (cmds.Contains(arguments.Command)) + if (cmds.Contains(arguments.Command)) { var users = new Dictionary(); var teams = new Dictionary(); @@ -891,7 +893,7 @@ public static async Task EnterpriseRoleCommand(this RoleDataManagement roleData, continue; } var ts = enterpriseData.Teams.Where(x => string.Equals(x.Name, member, StringComparison.CurrentCultureIgnoreCase)).ToArray(); - if (ts.Length == 1) + if (ts.Length == 1) { t = ts[0]; teams[t.Uid] = t; @@ -914,13 +916,13 @@ public static async Task EnterpriseRoleCommand(this RoleDataManagement roleData, { await roleData.AddUserToRole(role.Id, user.Id); } - else + else { await roleData.RemoveUserFromRole(role.Id, user.Id); } Console.WriteLine("Success"); } - catch (Exception e) + catch (Exception e) { Console.WriteLine($"Error: {e.Message}"); } @@ -1000,9 +1002,9 @@ public static async Task EnterpriseTeamCommand(this IEnterpriseContext context, false, queuedUserCount.ToString()); } - if (arguments.Queued) + if (arguments.Queued) { - foreach (var qteam in context.QueuedTeamManagement.QueuedTeams) + foreach (var qteam in context.QueuedTeamManagement.QueuedTeams) { EnterpriseNode node = null; if (qteam.ParentNodeId > 0) @@ -1018,7 +1020,7 @@ public static async Task EnterpriseTeamCommand(this IEnterpriseContext context, tab.AddRow(qteam.Name, qteam.Uid, node != null ? node.DisplayName : "", - "","","","", + "", "", "", "", true, queuedUserCount.ToString()); } } @@ -1073,14 +1075,14 @@ public static async Task EnterpriseTeamCommand(this IEnterpriseContext context, tab.AddRow(" Restrict Share:", team.RestrictSharing ? "Yes" : "No"); tab.AddRow(" Restrict View:", team.RestrictView ? "Yes" : "No"); } - else if (queuedTeam != null) + else if (queuedTeam != null) { tab.AddRow(" Queued Team Name:", queuedTeam.Name); tab.AddRow(" Queued Team UID:", queuedTeam.Uid); } var teamUid = team != null ? team.Uid : queuedTeam.Uid; - if (team != null) + if (team != null) { var users = context.EnterpriseData.GetUsersForTeam(teamUid) ?? Enumerable.Empty(); ; var userEmails = users @@ -1492,6 +1494,7 @@ private static object ParseDateCreatedFilter(string text) filter.Max = dt; filter.ExcludeMax = !hasEqual; } + return filter; } } else @@ -1570,48 +1573,91 @@ internal static async Task RunAuditEventsReport(this IEnterpriseContext context, Limit = options.Limit, }; + if (!string.IsNullOrEmpty(options.ReportType)) + { + rq.ReportType = options.ReportType; + } + if (options.Aggregate != null && options.Aggregate.Any()) + { + rq.Aggregate = options.Aggregate.ToArray(); + } + if (options.Columns != null && options.Columns.Any()) + { + rq.Columns = options.Columns.ToArray(); + } + var rs = await context.Enterprise.Auth.ExecuteAuthCommand(rq); - var tab = new Tabulate(4) {DumpRowNo = true}; - tab.AddHeader("Created", "Username", "Event", "Message"); - tab.MaxColumnWidth = 100; - foreach (var evt in rs.Events) - { - if (!evt.TryGetValue("audit_event_type", out var v)) continue; - var eventName = v.ToString(); - if (!context.AuditEvents.TryGetValue(eventName, out var eventType)) continue; + Tabulate tab; - var message = eventType.SyslogMessage; - do + if (rq.ReportType == "raw") + { + tab = new Tabulate(4) { DumpRowNo = true }; + tab.AddHeader("Created", "Username", "Event", "Message"); + tab.MaxColumnWidth = 100; + foreach (var evt in rs.Events) { - var match = Regex.Match(message, ParameterPattern); - if (!match.Success) break; - if (match.Groups.Count != 2) break; - var parameter = match.Groups[1].Value; - var value = ""; - if (evt.TryGetValue(parameter, out v)) + if (!evt.TryGetValue("audit_event_type", out var v)) continue; + var eventName = v.ToString(); + if (!context.AuditEvents.TryGetValue(eventName, out var eventType)) continue; + + var message = eventType.SyslogMessage; + do { - value = v.ToString(); - } + var match = Regex.Match(message, ParameterPattern); + if (!match.Success) break; + if (match.Groups.Count != 2) break; + var parameter = match.Groups[1].Value; + var value = ""; + if (evt.TryGetValue(parameter, out v)) + { + value = v.ToString(); + } - message = message.Remove(match.Groups[0].Index, match.Groups[0].Length); - message = message.Insert(match.Groups[0].Index, value); - } while (true); - var created = ""; - if (evt.TryGetValue("created", out v)) - { - created = v.ToString(); - if (long.TryParse(created, out var epoch)) + message = message.Remove(match.Groups[0].Index, match.Groups[0].Length); + message = message.Insert(match.Groups[0].Index, value); + } while (true); + var created = ""; + if (evt.TryGetValue("created", out v)) { - created = DateTimeOffset.FromUnixTimeSeconds(epoch).ToString("G"); + created = v.ToString(); + if (long.TryParse(created, out var epoch)) + { + created = DateTimeOffset.FromUnixTimeSeconds(epoch).ToString("G"); + } } + var username = ""; + if (evt.TryGetValue("username", out v)) + { + username = v.ToString(); + } + tab.AddRow(created, username, eventName, message); } - var username = ""; - if (evt.TryGetValue("username", out v)) + } + else + { + var columns = options.Aggregate.Concat(options.Columns).ToArray(); + tab = new Tabulate(columns.Length) { DumpRowNo = true }; + tab.AddHeader(columns); + tab.MaxColumnWidth = 100; + foreach (var evt in rs.Events) { - username = v.ToString(); + var values = columns.Select(x => { + object value = null; + evt.TryGetValue(x, out value); + if (value != null && (x == "last_created" || x == "first_created")) + { + if (value is IConvertible c) + { + var ts = c.ToInt64(CultureInfo.InvariantCulture); + var dt = DateTimeOffset.FromUnixTimeSeconds(ts); + value = dt.ToString("g"); + } + } + return value; + }).ToArray(); + tab.AddRow(values); } - tab.AddRow(created, username, eventName, message); } tab.Dump(); } @@ -2126,6 +2172,15 @@ class AuditReportOptions [Option("shared-folder-uid", Required = false, Default = null, HelpText = "shared folder UID")] public IEnumerable SharedFolderUid { get; set; } + + [Option("report-type", Required = false, Default = "raw", HelpText = "report type")] + public string ReportType { get; set; } + + [Option("aggregate", Required = false, HelpText = "aggregate columns")] + public IEnumerable Aggregate { get; set; } + + [Option("columns", Required = false, HelpText = "report columns")] + public IEnumerable Columns { get; set; } } class ManagedCompanyLoginOptions : EnterpriseGenericOptions diff --git a/KeeperSdk/KeeperSdk.csproj b/KeeperSdk/KeeperSdk.csproj index ead60a4..fd739ea 100644 --- a/KeeperSdk/KeeperSdk.csproj +++ b/KeeperSdk/KeeperSdk.csproj @@ -3,7 +3,7 @@ netstandard2.0;net452 7.1 - 1.0.5-beta01 + 1.0.5-beta02 Keeper Security Inc. .NET Keeper Sdk keeper password manager @@ -13,8 +13,8 @@ Github https://github.com/Keeper-Security/keeper-sdk-dotnet false - 1.0.5.21 - 1.0.5.21 + 1.0.5.22 + 1.0.5.22 MIT false true diff --git a/KeeperSdk/KeeperSdk.xml b/KeeperSdk/KeeperSdk.xml index 7ccf362..835cbcd 100644 --- a/KeeperSdk/KeeperSdk.xml +++ b/KeeperSdk/KeeperSdk.xml @@ -184,7 +184,6 @@ Defines the user interface methods required for authentication with Keeper. - @@ -279,28 +278,11 @@ When user picks a channel, client invokes channel's action channels.InvokeGetDataKeyAction - - - Defines a method that returns HTTP Web proxy credentials. Optional. - - - Keeper SDK calls this interface if it detects that access to the Internet is protected with HTTP Proxy. - Clients requests HTTP proxy credentials from the user and return them to the library. - - - - - - Requests HTTP Proxy credentials. - - HTTP Proxy information - Awaitable boolean result. TrueTrue resume login, False cancel. - Represents Keeper authentication. (async) - + @@ -344,6 +326,9 @@ + + + Provides types for connecting to Keeper servers (async). @@ -414,9 +399,6 @@ - - - Specifies login type @@ -549,7 +531,7 @@ Type of response. throws exception on error. Task returning JSON response. - + @@ -559,7 +541,7 @@ Protobuf request. Expected response type Task returning Protobuf response. - + @@ -660,8 +642,8 @@ Represents base authentication class - - + + @@ -687,6 +669,9 @@ + + + @@ -727,11 +712,6 @@ Ready to login - - - HTTP Proxy Authentication - - Device Approval @@ -776,8 +756,7 @@ Represents base Keeper authentication step - - + @@ -829,6 +808,12 @@ Verification code Awaitable task + + + Resumes login flow + + Awaitable task + Represents Two Factor Authentication step @@ -875,7 +860,6 @@ Sends push action to the channel Push action - Awaitable task @@ -883,7 +867,11 @@ - Awaitable task + + + + Resumes login + @@ -904,24 +892,6 @@ Biometric key Awaitable task - - - Represents HTTP Proxy Authentication step - - - - - Gets HTTP Proxy URI - - - - - Sets HTTP Proxy credentials - - Proxy username - Proxy password - Awaitable task - Represents SSO Login step @@ -975,7 +945,11 @@ Requests SSO Approval SSO approval channel - + + + + Resumes login flow + @@ -1093,7 +1067,7 @@ The authenticated connection. JSON authenticated command. A Task returning basic JSON response. - + @@ -1106,7 +1080,7 @@ if True throw exception on Keeper error. A Task returning JSON response. Keeper API Exception. - + @@ -1117,7 +1091,7 @@ SON authenticated command. Awaitable task. Keeper API Exception. - + @@ -1144,6 +1118,9 @@ + + + Describes Keeper server endpoint. @@ -1191,9 +1168,6 @@ - - - @@ -1498,32 +1472,6 @@ Password complexity rule matcher. A task returning a new password. - - - Http Proxy credentials action - - - - - - Defines methods and properties for http proxy authentication. - - - - - Gets HTTP proxy URI - - - - - Gets Proxy-Authentication header - - - - - Accepts HTTP proxy credentials - - Base 2FA channel interface @@ -1742,16 +1690,16 @@ Defines the method that starts U2F Security Key 2FA. Optional. - Implement this interface along with Auth UI + Implement this interface along with Auth UI if you plan to support Security Key (Yubikey and any other U2F compatible keys). - + U2F key authentications required. - Public Key Credential request. + Public Key Credential request. A task that returns WebAuthn signature. @@ -1791,30 +1739,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -2419,6 +2343,170 @@ > + + + Represents Event Period Filter + + + + + Maximum value. + + UNIX epoch time in seconds + + + + Mimimum value. + + UNIX epoch time in seconds + + + + Exclude Maximum value. + + Less than Maxinum value if true + + + + Exclude Minimum value. + + Greater than Mininum value if true + + + + Represents Audit Report Filter + + + + + Event Types + + + + + + Users + + + + + Target Users + + + + + Record UIDs + + + + + Shared Folder UIDs + + + + + Event Time + + + Predefined Filters: today, yesterday, last_30_days, last_7_days, month_to_date, last_month, year_to_date, last_year + + + + Represents Audit Report Command + + + + + + + + Report Type + + Report TypeDescription + rawPlain audit events. Default. + spanEvents consolidated by . Creation time is dropped. + monthEvents consolidated by event month and . + weekconsolidated by event week ... + dayconsolidated by event day ... + hourconsolidated by event hour ... + + + + + + Report Scope + + ScopeDescription + enterpriseEnterprise + userLogged in user + + + + + + Sort Order + + Sort OrderDescription + descendingDefault + ascending + + + + + + Number of rows to return + + Maximum: 1000 - raw reports, 2000 - consolidated reports + + + + Repord Filder + + + + + + Aggregate columns + + ColumnDescription + occurrencesEvent count + first_createdFirst event time. MIN(Created) + last_createdLast event time. MAX(Created) + + + Consolidated reports only. + + + + Group by columns + + ColumnDescription + audit_event_typeEvent Type + usernameUsername + ip_addressIP Address + keeper_versionKeeper Client Version + to_usernameTarget Username + record_uidRecord UID + shared_folder_uidShared Folder UID + team_uidTeam UID + + + + + + Represents Audit Report Response + + + + + Events + + + + + Provides Audit Report Commands + + Enterprise Audit Log access methods. @@ -2431,11 +2519,26 @@ Keeper Connection Awaitable task returning supported audit events - + Gets audit events in descending order. Keeper Connection + Audit report filetr + Recent event epoch time in seconds + Latest event epoch time in seconds + Awaitable task returning a tuple. Item1 contains the audit event list. Item2 the epoch time in seconds to resume + + + This method returns first 1000 events. To get the next chunk of audit events pass the second parameter of result into recentUnixTime parameter. + Created property of is ignored. + + + + + Gets audit events for a user in descending order. + + Keeper Connection User email Recent event epoch time in seconds Latest event epoch time in seconds @@ -2467,8 +2570,6 @@ Instantiates instance. - Keeper authentication. - Enterprise tree key. Optional. @@ -2568,7 +2669,7 @@ Invites user to enterprise Email Address - Full Name + Optional Invited User @@ -2691,7 +2792,7 @@ Toggles "Node Isolation" flag for enterprise node. - Enterprise Data. + Enterprise Data. Node ID Awaitable Task @@ -2699,7 +2800,7 @@ Creates Enterprise Node - Enterprise Data + Enterprise Data Node Name Parent Node Awaitable task returning created node @@ -2708,7 +2809,7 @@ Updates existing node - Enterprise Data + Enterprise Data Enterprise node New Parent Node Awaitable task @@ -2717,7 +2818,7 @@ Deletes existing node - Enterprise Data + Enterprise Data Node ID to be deleted Awaitable task @@ -2753,13 +2854,12 @@ - + Initialises EnterpriseLoader instance. Keeper Authentication Enterprise data plugins - Enterprise tree key. Optional. @@ -2802,7 +2902,6 @@ Defines methods for modifying enterprise users and teams. - @@ -2854,14 +2953,16 @@ Deletes Enterprise Team. - Enterprise Team + Team UID Task Adds Users to Team. + Emails Team Uid + (Optional) Task @@ -3172,6 +3273,15 @@ + + + + + + + + + Represends Managed Companies enterprise data. @@ -3185,18 +3295,6 @@ Get a list of all managed companies in the enterprise. - - - - - - - - - - - - @@ -3206,12 +3304,21 @@ + + + + + + + + + Represends Managed Companies create/update options @@ -3234,7 +3341,7 @@ - Number of Seats + Maximum Number of Seats. -1 unlimited @@ -3242,6 +3349,11 @@ File/Storage Plan + + + Addons + + Defines Managed Company actions @@ -3855,12 +3967,6 @@ - - - - - - Provides methods for JSON (de)serialization. @@ -3880,6 +3986,7 @@ Type of JSON object. JSON object. + Pretty print JSON data. @@ -3960,9 +4067,6 @@ Vault Typed Record - - - Provides utilities common for all Keeper modules. @@ -5061,7 +5165,7 @@ Delete all links for object entity UID - List of Object UIDs to delete. + List of Object UIDs to delete. @@ -5694,6 +5798,9 @@ Represents an exception that occurs when current user requests other user's public for the first time. + + + Gets user email to send share invite @@ -5781,7 +5888,7 @@ Parent Folder UID. Shared Folder creation options. Optional. A task returning created folder. - Pass parameter to create a Shared Folder. + Pass sharedFolderOptions parameter to create a Shared Folder. @@ -5893,11 +6000,17 @@ User account email Awaitable task. + + + Define methods for Keeper Secret Maneger (KSM) + + Gets Keeper Secret Manager Application Details Application UID. + Force reloading Secret Manager Application Info @@ -5962,7 +6075,7 @@ Shared Folder UID. User email or Team UID. - Type of parameter. + Type of userId parameter. Shared Folder User Permissions. Awaitable task. @@ -5978,7 +6091,7 @@ Shared Folder UID. User email or Team UID. - Type of parameter. + Type of userId parameter. Awaitable task. @@ -7569,6 +7682,16 @@ Australia + + + Japan + + + + + Canada + + Field number for the "encryptedTransmissionKey" field. @@ -7803,6 +7926,9 @@ Field number for the "ssoClientVersion" field. + + Field number for the "sessionTokenTypeModifier" field. + Field number for the "companyName" field. @@ -8265,6 +8391,9 @@ Field number for the "securityReportIncrementalData" field. + + Field number for the "userId" field. + Field number for the "securityReport" field. @@ -8567,32 +8696,17 @@ Field number for the "type" field. - - Field number for the "sourceRegionGroupId" field. - - - Field number for the "destinationRegionGroupId" field. - - - Field number for the "sourceRegionName" field. - - - Field number for the "destinationRegionName" field. + + Field number for the "sourceRegion" field. Field number for the "payload" field. - - Field number for the "username" field. - - - Field number for the "locale" field. - Field number for the "supportedLanguage" field. - - Field number for the "type" field. + + Field number for the "destinationRegion" field. Field number for the "key" field. @@ -9102,6 +9216,9 @@ optional, defaults to obfuscated device id + + Field number for the "appClientType" field. + Field number for the "appRecordUid" field. @@ -9158,6 +9275,9 @@ Field number for the "accessExpireOn" field. + + Field number for the "appClientType" field. + Field number for the "appRecordUid" field. @@ -9282,9 +9402,44 @@ delete timer when expiration==0 + + Field number for the "uid" field. + + + + accountUid or teamUid or recordUid + + + + Field number for the "message" field. + Field number for the "revision" field. + + Field number for the "userAccessStatus" field. + + + + uid is accountUid + + + + Field number for the "teamAccessStatus" field. + + + + uid is teamUid + + + + Field number for the "recordAccessStatus" field. + + + + uid is recordUid + + Field number for the "fileNames" field. @@ -9314,21 +9469,432 @@ reason to delete - - Holder for reflection information generated from breachwatch.proto + + Field number for the "authVerifier" field. - - File descriptor for breachwatch.proto + + Field number for the "encryptionParams" field. - - - note: this also is used for master password where the recordUid is blank - + + Field number for the "fromServiceProvider" field. - - - for any user_auth passwords, including the passwords used through Pythia - + + Field number for the "iterationsChange" field. + + + Field number for the "encryptedSessionToken" field. + + + Holder for reflection information generated from BI.proto + + + File descriptor for BI.proto + + + Field number for the "encryptedSessionToken" field. + + + Field number for the "returnMcEnterpiseIds" field. + + + Field number for the "ip" field. + + + Field number for the "username" field. + + + Field number for the "userId" field. + + + Field number for the "enterpriseUserId" field. + + + Field number for the "status" field. + + + Field number for the "statusMessage" field. + + + Field number for the "mcEnterpriseIds" field. + + + Field number for the "hasMSPPermission" field. + + + Field number for the "deletedMcEnterpriseIds" field. + + + Container for nested types declared in the ValidateSessionTokenResponse message type. + + + + -- POST: /bi_api/v2/console/subscription/status gzgb + + + + Field number for the "autoRenewal" field. + + + Field number for the "currentPaymentMethod" field. + + + Field number for the "checkoutLink" field. + + + Field number for the "licenseCreateDate" field. + + + Field number for the "isDistributor" field. + + + Field number for the "isLegacyMsp" field. + + + Field number for the "licenseStats" field. + + + Field number for the "gradientStatus" field. + + + Field number for the "type" field. + + + Field number for the "available" field. + + + Field number for the "used" field. + + + Container for nested types declared in the LicenseStats message type. + + + Field number for the "nextOn" field. + + + Field number for the "daysLeft" field. + + + Field number for the "isTrial" field. + + + Field number for the "type" field. + + + Field number for the "card" field. + + + Field number for the "sepa" field. + + + Field number for the "paypal" field. + + + Field number for the "failedBilling" field. + + + Field number for the "vendor" field. + + + Field number for the "purchaseOrder" field. + + + Container for nested types declared in the PaymentMethod message type. + + + Field number for the "last4" field. + + + Field number for the "brand" field. + + + Field number for the "last4" field. + + + Field number for the "country" field. + + + Field number for the "name" field. + + + Field number for the "name" field. + + + + -- POST: /bi_api/v2/console/subscription/mc_pricing + + + + Field number for the "addons" field. + + + Field number for the "filePlans" field. + + + + -- POST: /bi_api/v2/console/subscription/mc_pricing + + + + Field number for the "basePlans" field. + + + Field number for the "addons" field. + + + Field number for the "filePlans" field. + + + Field number for the "id" field. + + + Field number for the "cost" field. + + + Field number for the "id" field. + + + Field number for the "cost" field. + + + Field number for the "amountConsumed" field. + + + Field number for the "id" field. + + + Field number for the "cost" field. + + + Field number for the "amount" field. + + + Field number for the "amountPer" field. + + + Field number for the "currency" field. + + + Container for nested types declared in the Cost message type. + + + + -- POST: /bi_api/v2/console/invoice/search + + + + Field number for the "size" field. + + + Field number for the "startingAfterId" field. + + + Field number for the "invoices" field. + + + Field number for the "id" field. + + + Field number for the "invoiceNumber" field. + + + Field number for the "invoiceDate" field. + + + Field number for the "licenseCount" field. + + + Field number for the "totalCost" field. + + + Field number for the "invoiceType" field. + + + Container for nested types declared in the Invoice message type. + + + Field number for the "amount" field. + + + Field number for the "currency" field. + + + + -- POST: /bi_api/v2/console/invoice/download + + + + Field number for the "invoiceNumber" field. + + + Field number for the "link" field. + + + Field number for the "fileName" field. + + + + -- POST: /bi_api/v2/console/reporting/daily_snapshot + + + + Field number for the "month" field. + + + Field number for the "year" field. + + + Field number for the "records" field. + + + Field number for the "mcEnterprises" field. + + + Field number for the "date" field. + + + Field number for the "mcEnterpriseId" field. + + + Field number for the "maxLicenseCount" field. + + + Field number for the "maxFilePlanTypeId" field. + + + Field number for the "maxBasePlanId" field. + + + Field number for the "addons" field. + + + Container for nested types declared in the SnapshotRecord message type. + + + Field number for the "maxAddonId" field. + + + Field number for the "units" field. + + + Field number for the "id" field. + + + Field number for the "name" field. + + + + -- POST: /bi_api/v2/enterprise_console/mapping/addons + + + + Field number for the "addons" field. + + + Field number for the "filePlans" field. + + + Field number for the "id" field. + + + Field number for the "name" field. + + + + -- POST: /bi_api/v2/enterprise_console/gradient/validate-key + + + + Field number for the "gradientKey" field. + + + Field number for the "success" field. + + + Field number for the "message" field. + + + + -- POST: /bi_api/v2/enterprise_console/gradient/add-service + + + + Field number for the "serviceName" field. + + + Field number for the "serviceDesc" field. + + + Field number for the "success" field. + + + Field number for the "message" field. + + + + -- POST: /bi_api/v2/enterprise_console/gradient/save + + + + Field number for the "gradientKey" field. + + + Field number for the "enterpriseUserId" field. + + + Field number for the "success" field. + + + Field number for the "status" field. + + + Field number for the "message" field. + + + + -- POST: /bi_api/v2/enterprise_console/gradient/remove + + + + Field number for the "enterpriseUserId" field. + + + Field number for the "success" field. + + + Field number for the "message" field. + + + + -- POST: /bi_api/v2/enterprise_console/gradient/sync + + + + Field number for the "enterpriseUserId" field. + + + Field number for the "success" field. + + + Field number for the "status" field. + + + Field number for the "message" field. + + + Holder for reflection information generated from breachwatch.proto + + + File descriptor for breachwatch.proto + + + + note: this also is used for master password where the recordUid is blank + + + + + for any user_auth passwords, including the passwords used through Pythia + Field number for the "recordUid" field. @@ -9878,6 +10444,9 @@ Field number for the "userPrivilege" field. + + Field number for the "distributor" field. + Field number for the "nodeId" field. @@ -9970,6 +10539,12 @@ Field number for the "jobTitle" field. + + Field number for the "tfaEnabled" field. + + + Field number for the "transferAcceptanceStatus" field. + Field number for the "enterpriseUserId" field. @@ -10127,6 +10702,54 @@ Field number for the "userType" field. + + Field number for the "distributors" field. + + + Field number for the "name" field. + + + Field number for the "mspInfos" field. + + + Field number for the "enterpriseId" field. + + + Field number for the "enterpriseName" field. + + + Field number for the "allocatedLicenses" field. + + + + MAX_INT is infinity + + + + Field number for the "allowedMcProducts" field. + + + + codes of allowed MC Products + + + + Field number for the "allowedAddOns" field. + + + Field number for the "maxFilePlanType" field. + + + Field number for the "managedCompanies" field. + + + Field number for the "allowUnlimitedLicenses" field. + + + + Allows MSP allocate Infinity as number of licenses to its MCs. + + Field number for the "mcEnterpriseId" field. @@ -10148,6 +10771,11 @@ Field number for the "isExpired" field. + + + this is also the indication of whether or not it is expired as it gets expired when it is paused. + + Field number for the "treeKey" field. @@ -10199,6 +10827,60 @@ Field number for the "activationTime" field. + + Field number for the "includedInProduct" field. + + + Field number for the "mcProduct" field. + + + Field number for the "addOns" field. + + + Field number for the "filePlanType" field. + + + Field number for the "maxLicenses" field. + + + Field number for the "fixedMaxLicenses" field. + + + + permits granted by a distributor to its MSP to pass to MC + + + + Field number for the "restricted" field. + + + + if false then no need to check the rest + + + + Field number for the "maxAllowedLicenses" field. + + + + obsolete in favor of allowUnlimitedLicenses + + + + Field number for the "allowedMcProducts" field. + + + Field number for the "allowedAddOns" field. + + + Field number for the "maxFilePlanType" field. + + + Field number for the "allowUnlimitedLicenses" field. + + + Field number for the "mcDefaults" field. + Field number for the "paid" field. @@ -10256,6 +10938,12 @@ Field number for the "hasMSPLegacyLog" field. + + Field number for the "mspPermits" field. + + + Field number for the "distributor" field. + Field number for the "bridgeId" field. @@ -10474,11 +11162,29 @@ Field number for the "users" field. - - Field number for the "records" field. + + Field number for the "records" field. + + + Field number for the "continuationToken" field. + + + Field number for the "user" field. + + + Field number for the "backupUid" field. + + + Field number for the "fileName" field. + + + Field number for the "created" field. + + + Field number for the "downloadUrl" field. - - Field number for the "continuationToken" field. + + Field number for the "files" field. Field number for the "roleId" field. @@ -10670,6 +11376,26 @@ Field number for the "status" field. + + Field number for the "nodeIds" field. + + + Field number for the "includeNonShared" field. + + + Field number for the "recordOwners" field. + + + Field number for the "enterpriseUserId" field. + + + Field number for the "shared" field. + + + + true if at least one owned record is shared. + + Field number for the "enterpriseUserIds" field. @@ -10684,6 +11410,9 @@ Field number for the "continuationToken" field. + + Field number for the "includeTotalMatchingRecordsInFirstResponse" field. + Field number for the "auditUserData" field. @@ -11126,12 +11855,41 @@ Field number for the "sharedFolderUid" field. - - Field number for the "sharingAdmins" field. + + Field number for the "recordUid" field. - + Field number for the "username" field. + + Field number for the "email" field. + + + Field number for the "fullName" field. + + + + The user's full name. + + + + Field number for the "jobTitle" field. + + + Field number for the "isMSPMCAdmin" field. + + + Field number for the "isInSharedFolder" field. + + + Field number for the "isShareAdminForRequestedObject" field. + + + Field number for the "isShareAdminForSharedFolderOwner" field. + + + Field number for the "userProfileExts" field. + Field number for the "teams" field. @@ -11220,29 +11978,184 @@ Field number for the "domainAlias" field. - - Field number for the "controllerUid" field. + + Field number for the "users" field. - - Field number for the "controllerName" field. + + Field number for the "clientVersion" field. - - Field number for the "deviceToken" field. + + Field number for the "enterpriseUserId" field. - - Field number for the "deviceName" field. + + + from enterprise_user_add + - + + Field number for the "username" field. + + Field number for the "nodeId" field. - - Field number for the "created" field. + + Field number for the "encryptedData" field. - - Field number for the "lastModified" field. + + Field number for the "keyType" field. + + + Field number for the "fullName" field. + + + Field number for the "jobTitle" field. + + + Field number for the "enterpriseUsersDataKey" field. + + + + from set_enterprise_user_data_key_by_admin + + + + Field number for the "authVerifier" field. + + + + from APIRequest.CreateUserRequest, used in /authentication/request_create_user + + + + Field number for the "encryptionParams" field. + + + Field number for the "rsaPublicKey" field. + + + Field number for the "rsaEncryptedPrivateKey" field. + + + Field number for the "eccPublicKey" field. + + + Field number for the "eccEncryptedPrivateKey" field. + + + Field number for the "encryptedDeviceToken" field. + + + Field number for the "encryptedClientKey" field. + + + Field number for the "results" field. + + + Field number for the "enterpriseUserId" field. + + + Field number for the "code" field. + + + Field number for the "message" field. + + + Field number for the "additionalInfo" field. + + + Field number for the "users" field. + + + Field number for the "clientVersion" field. + + + Field number for the "enterpriseUserId" field. + + + Field number for the "username" field. + + + Field number for the "nodeId" field. + + + Field number for the "encryptedData" field. + + + Field number for the "keyType" field. + + + Field number for the "fullName" field. + + + Field number for the "jobTitle" field. + + + Field number for the "suppressEmailInvite" field. + + + Field number for the "inviteeLocale" field. + + + Field number for the "move" field. + + + Field number for the "roleId" field. + + + Field number for the "results" field. + + + Field number for the "success" field. + + + Field number for the "code" field. + + + Field number for the "message" field. + + + Field number for the "additionalInfo" field. + + + Field number for the "enterpriseUserId" field. + + + Field number for the "success" field. + + + Field number for the "verificationCode" field. + + + Field number for the "code" field. + + + Field number for the "message" field. + + + Field number for the "additionalInfo" field. + + + Field number for the "mspEnterpriseId" field. + + + Field number for the "maxAllowedLicenses" field. + + + + obsolete in favor of allowUnlimitedLicenses + + + + Field number for the "allowedMcProducts" field. + + + Field number for the "allowedAddOns" field. + + + Field number for the "maxFilePlanType" field. - - Field number for the "controllers" field. + + Field number for the "allowUnlimitedLicenses" field. Holder for reflection information generated from folder.proto @@ -11250,11 +12163,6 @@ File descriptor for folder.proto - - - ADD, UPDATE, DELETE - - Field number for the "encryptedKey" field. @@ -11474,8 +12382,13 @@ Field number for the "expiration" field. - - Field number for the "sharedFolderUpdateOperation" field. + + Field number for the "sharedFolderUpdateOperation_dont_use" field. + + + + obsolete field. we only use this request for shared folder update now. + Field number for the "sharedFolderUid" field. @@ -11556,11 +12469,13 @@ Field number for the "sharedFolderRemoveTeam" field. - - Field number for the "encryptedDeviceToken" field. + + Field number for the "sharedFolderOwner" field. - - Field number for the "messageSessionUid" field. + + + should have a sharing relationship w/ the calling user; ""=No Change(default); "delete"=unset + Field number for the "recordUid" field. @@ -11610,6 +12525,90 @@ Field number for the "sharedFolderRemoveTeamStatus" field. + + Field number for the "sharedFolders" field. + + + Field number for the "sharedFolderRecords" field. + + + Field number for the "deletedRecordData" field. + + + Field number for the "usernames" field. + + + Field number for the "sharedFolderUid" field. + + + Field number for the "folderUid" field. + + + Field number for the "parentUid" field. + + + Field number for the "sharedFolderKey" field. + + + Field number for the "folderKeyType" field. + + + Field number for the "data" field. + + + Field number for the "dateDeleted" field. + + + Field number for the "revision" field. + + + Field number for the "folderUid" field. + + + Field number for the "recordUid" field. + + + Field number for the "sharedRecordKey" field. + + + Field number for the "dateDeleted" field. + + + Field number for the "revision" field. + + + Field number for the "recordUid" field. + + + Field number for the "ownerUid" field. + + + Field number for the "revision" field. + + + Field number for the "clientModifiedTime" field. + + + Field number for the "data" field. + + + Field number for the "accountUid" field. + + + Field number for the "username" field. + + + Field number for the "folders" field. + + + Field number for the "records" field. + + + Field number for the "folderUid" field. + + + Field number for the "recordUid" field. + Holder for reflection information generated from push.proto @@ -11775,6 +12774,9 @@ Field number for the "enterprise" field. + + Field number for the "pam" field. + Field number for the "recordTypes" field. @@ -11787,6 +12789,9 @@ Field number for the "enterpriseCounter" field. + + Field number for the "pamCounter" field. + Field number for the "recordTypeId" field. @@ -12036,6 +13041,15 @@ Field number for the "records" field. + + Field number for the "record_uid" field. + + + Field number for the "revert_to_revision" field. + + + Field number for the "records" field. + Field number for the "record_uid" field. @@ -12258,29 +13272,24 @@ Field number for the "clientModifiedTime" field. - - Field number for the "ownerRecordUid" field. - - - - the record uid of the owner record for a linked record - + + Field number for the "nonSharedData" field. - - Field number for the "encryptedLinkedRecordKey" field. + + Field number for the "linkedRecordData" field. - - - the record key of the linked record encrypted with the key of the owner record - + + + a list of child record data + Field number for the "fileId" field. - + json object of unencrypted data (currently contains only file ids) - + Field number for the "fileSize" field. @@ -12288,6 +13297,15 @@ Field number for the "thumbnailSize" field. + + Field number for the "recordKeyType" field. + + + Field number for the "recordKey" field. + + + Field number for the "recordUid" field. + Field number for the "recordUid" field. @@ -12306,6 +13324,28 @@ Field number for the "noPermissionRecordUid" field. + + Field number for the "uid" field. + + + Field number for the "isAdmin" field. + + + + used in the response + + + + Field number for the "objectType" field. + + + + used for both request and response + + + + Field number for the "isObjectShareAdmin" field. + Field number for the "addSharedRecord" field. @@ -12348,6 +13388,9 @@ Field number for the "removeVaultData" field. + + Field number for the "expiration" field. + Field number for the "addSharedRecordStatus" field. @@ -12422,6 +13465,14 @@ users with status != ACTIVE will not be returned if true - used for autoshare, false - used for manage share relationships + + Field number for the "sharedFolderUid" field. + + + + the shared folder uid + + Field number for the "shareRelationships" field. @@ -12503,6 +13554,14 @@ only for enterprise user + + Field number for the "isAdminOfSharedFolderOwner" field. + + + + only used for enterprise user + + Field number for the "teamname" field. @@ -12518,6 +13577,36 @@ Field number for the "enterpriseId" field. + + Field number for the "transferRecords" field. + + + Field number for the "username" field. + + + Field number for the "recordUid" field. + + + Field number for the "recordKey" field. + + + Field number for the "useEccKey" field. + + + Field number for the "transferRecordStatus" field. + + + Field number for the "username" field. + + + Field number for the "recordUid" field. + + + Field number for the "status" field. + + + Field number for the "message" field. + Holder for reflection information generated from ssocloud.proto diff --git a/KeeperSdk/auth/Auth.cs b/KeeperSdk/auth/Auth.cs index 92d872a..f55a4a2 100644 --- a/KeeperSdk/auth/Auth.cs +++ b/KeeperSdk/auth/Auth.cs @@ -17,7 +17,6 @@ namespace KeeperSecurity.Authentication.Async /// Defines the user interface methods required for authentication with Keeper. /// /// - /// /// /// public interface IAuthUI : IAuthCallback @@ -118,7 +117,7 @@ public interface IAuthSsoUI : ISsoLogoutCallback /// /// Represents Keeper authentication. (async) /// - /// + /// /// /// public class Auth : AuthCommon, IAuth @@ -676,6 +675,7 @@ private async Task RequestDataKey(LoginContext v3, ByteString login return await ResumeLogin(v3, loginToken); } + /// public override void Dispose() { Ui = null; diff --git a/KeeperSdk/auth/AuthCommon.cs b/KeeperSdk/auth/AuthCommon.cs index 64d8e42..26eb714 100644 --- a/KeeperSdk/auth/AuthCommon.cs +++ b/KeeperSdk/auth/AuthCommon.cs @@ -153,7 +153,7 @@ public interface IAuthentication : IAuthEndpoint /// Type of response. /// throws exception on error. /// Task returning JSON response. - /// + /// Task ExecuteAuthCommand(AuthenticatedCommand command, Type responseType, bool throwOnError); /// @@ -163,7 +163,7 @@ public interface IAuthentication : IAuthEndpoint /// Protobuf request. /// Expected response type /// Task returning Protobuf response. - /// + /// Task ExecuteAuthRest(string endpoint, IMessage request, Type responseType = null); /// @@ -310,8 +310,8 @@ public bool CheckPasswordValid(string password) /// /// Represents base authentication class /// - /// - /// + /// + /// public abstract class AuthCommon : IAuthentication, IDisposable { /// @@ -440,6 +440,7 @@ protected virtual IWebProxy GetStoredProxy(Uri proxyUri, string[] proxyAuth) return null; } + /// public async Task DetectProxy(Action onProxyDetected) { var keeperUri = new Uri($"https://{Endpoint.Server}/api/rest/ping"); diff --git a/KeeperSdk/auth/AuthExtensions.cs b/KeeperSdk/auth/AuthExtensions.cs index e942245..a634fb8 100644 --- a/KeeperSdk/auth/AuthExtensions.cs +++ b/KeeperSdk/auth/AuthExtensions.cs @@ -29,7 +29,7 @@ public static bool IsAuthenticated(this IAuthentication auth) /// The authenticated connection. /// JSON authenticated command. /// A Task returning basic JSON response. - /// + /// public static async Task ExecuteAuthCommand(this IAuthentication auth, AuthenticatedCommand command) { return await auth.ExecuteAuthCommand(command, typeof(KeeperApiResponse), true); @@ -45,7 +45,7 @@ public static async Task ExecuteAuthCommand(this IAuthenticat /// if True throw exception on Keeper error. /// A Task returning JSON response. /// Keeper API Exception. - /// + /// public static async Task ExecuteAuthCommand(this IAuthentication auth, TC command, bool throwOnError = true) where TC : AuthenticatedCommand where TR : KeeperApiResponse @@ -61,7 +61,7 @@ public static async Task ExecuteAuthCommand(this IAuthentication aut /// SON authenticated command. /// Awaitable task. /// Keeper API Exception. - /// + /// public static Task ExecuteAuthCommand(this IAuthentication auth, TC command) where TC : AuthenticatedCommand { diff --git a/KeeperSdk/auth/AuthSteps.cs b/KeeperSdk/auth/AuthSteps.cs index c5e8118..f0ad153 100644 --- a/KeeperSdk/auth/AuthSteps.cs +++ b/KeeperSdk/auth/AuthSteps.cs @@ -49,8 +49,7 @@ public enum AuthState /// /// Represents base Keeper authentication step /// - /// - /// + /// /// /// /// @@ -222,7 +221,6 @@ public string GetPhoneNumber(TwoFactorChannel channel) /// Sends push action to the channel /// /// Push action - /// Awaitable task public Task SendPush(TwoFactorPushAction action) { return OnSendPush?.Invoke(action); @@ -235,7 +233,6 @@ public Task SendPush(TwoFactorPushAction action) /// /// /// - /// Awaitable task public Task SendCode(TwoFactorChannel channel, string code) { return OnSendCode?.Invoke(channel, code); @@ -244,11 +241,8 @@ public Task SendCode(TwoFactorChannel channel, string code) internal Func OnResume; /// - /// Sends verification code + /// Resumes login /// - /// - /// - /// Awaitable task public Task Resume() { return OnResume?.Invoke(); diff --git a/KeeperSdk/auth/Ui.cs b/KeeperSdk/auth/Ui.cs index 838a2b7..83b27e0 100644 --- a/KeeperSdk/auth/Ui.cs +++ b/KeeperSdk/auth/Ui.cs @@ -412,16 +412,16 @@ public interface ITwoFactorPushInfo : ITwoFactorChannelInfo /// Defines the method that starts U2F Security Key 2FA. Optional. /// /// - /// Implement this interface along with Auth UI + /// Implement this interface along with Auth UI /// if you plan to support Security Key (Yubikey and any other U2F compatible keys). /// - /// + /// public interface IAuthSecurityKeyUI { /// /// U2F key authentications required. /// - /// Public Key Credential request. + /// Public Key Credential request. /// A task that returns WebAuthn signature. Task AuthenticatePublicKeyRequest(PublicKeyCredentialRequestOptions request); } diff --git a/KeeperSdk/enterprise/AuditLog.cs b/KeeperSdk/enterprise/AuditLog.cs index d305b97..b73d5a2 100644 --- a/KeeperSdk/enterprise/AuditLog.cs +++ b/KeeperSdk/enterprise/AuditLog.cs @@ -5,108 +5,15 @@ using System.Threading.Tasks; using KeeperSecurity.Authentication; using KeeperSecurity.Commands; +using KeeperSecurity.Enterprise.AuditLogCommands; #if NET452_OR_GREATER using KeeperSecurity.Utils; #endif namespace KeeperSecurity { - namespace Commands + namespace Commands { - [DataContract] - public class CreatedFilter - { - [DataMember(Name = "max", EmitDefaultValue = false)] - public long? Max { get; set; } - - [DataMember(Name = "min", EmitDefaultValue = false)] - public long? Min { get; set; } - - [DataMember(Name = "exclude_max")] - public bool ExcludeMax { get; set; } = true; - - [DataMember(Name = "exclude_min")] - public bool ExcludeMin { get; set; } - } - - /// - /// Represents Audit Report Filter - /// - [DataContract] - public class ReportFilter - { - /// - /// Event Types - /// - /// - [DataMember(Name = "audit_event_type", EmitDefaultValue = false)] - public string[] EventTypes { get; set; } - - /// - /// Users - /// - [DataMember(Name = "username", EmitDefaultValue = false)] - public string[] Username { get; set; } - - /// - /// Target Users - /// - [DataMember(Name = "to_username", EmitDefaultValue = false)] - public string[] ToUsername { get; set; } - - /// - /// Record UIDs - /// - [DataMember(Name = "record_uid", EmitDefaultValue = false)] - public string[] RecordUid { get; set; } - - /// - /// Shared Folder UIDs - /// - [DataMember(Name = "shared_folder_uid", EmitDefaultValue = false)] - public string[] SharedFolderUid { get; set; } - - /// - /// Event Time - /// - /// - /// Predefined Filters: today, yesterday, last_30_days, last_7_days, month_to_date, last_month, year_to_date, last_year - [DataMember(Name = "created", EmitDefaultValue = false)] - public object Created { get; set; } - - } - - [DataContract] - public class GetAuditEventReportsCommand : AuthenticatedCommand - { - public GetAuditEventReportsCommand() : base("get_audit_event_reports") - { - } - - [DataMember(Name = "report_type")] - public string ReportType { get; set; } = "raw"; - - [DataMember(Name = "scope")] - public string Scope { get; internal set; } = "enterprise"; - - [DataMember(Name = "order")] - public string Order { get; set; } = "descending"; - - [DataMember(Name = "limit")] - public int Limit { get; set; } = 1000; - - [DataMember(Name = "filter", EmitDefaultValue = false)] - public ReportFilter Filter { get; set; } - } - - [DataContract] - public class GetAuditEventReportsResponse : KeeperApiResponse - { - - [DataMember(Name = "audit_event_overview_report_rows")] - public List> Events { get; private set; } - } - [DataContract] public class GetAuditEventDimensionsCommand : AuthenticatedCommand { @@ -160,11 +67,204 @@ public class GetAuditEventDimensionsResponse : KeeperApiResponse namespace Enterprise { + + namespace AuditLogCommands + { + /// + /// Represents Event Period Filter + /// + [DataContract] + public class CreatedFilter + { + /// + /// Maximum value. + /// + /// UNIX epoch time in seconds + [DataMember(Name = "max", EmitDefaultValue = false)] + public long? Max { get; set; } + + /// + /// Mimimum value. + /// + /// UNIX epoch time in seconds + [DataMember(Name = "min", EmitDefaultValue = false)] + public long? Min { get; set; } + + /// + /// Exclude Maximum value. + /// + /// Less than Maxinum value if true + [DataMember(Name = "exclude_max")] + public bool ExcludeMax { get; set; } = true; + + /// + /// Exclude Minimum value. + /// + /// Greater than Mininum value if true + [DataMember(Name = "exclude_min")] + public bool ExcludeMin { get; set; } + } + + /// + /// Represents Audit Report Filter + /// + [DataContract] + public class ReportFilter + { + /// + /// Event Types + /// + /// + [DataMember(Name = "audit_event_type", EmitDefaultValue = false)] + public string[] EventTypes { get; set; } + + /// + /// Users + /// + [DataMember(Name = "username", EmitDefaultValue = false)] + public string[] Username { get; set; } + + /// + /// Target Users + /// + [DataMember(Name = "to_username", EmitDefaultValue = false)] + public string[] ToUsername { get; set; } + + /// + /// Record UIDs + /// + [DataMember(Name = "record_uid", EmitDefaultValue = false)] + public string[] RecordUid { get; set; } + + /// + /// Shared Folder UIDs + /// + [DataMember(Name = "shared_folder_uid", EmitDefaultValue = false)] + public string[] SharedFolderUid { get; set; } + + /// + /// Event Time + /// + /// + /// Predefined Filters: today, yesterday, last_30_days, last_7_days, month_to_date, last_month, year_to_date, last_year + [DataMember(Name = "created", EmitDefaultValue = false)] + public object Created { get; set; } + } + + /// + /// Represents Audit Report Command + /// + [DataContract] + public class GetAuditEventReportsCommand : AuthenticatedCommand + { + /// + public GetAuditEventReportsCommand() : base("get_audit_event_reports") + { + } + + /// + /// Report Type + /// + /// Report TypeDescription + /// rawPlain audit events. Default. + /// spanEvents consolidated by . Creation time is dropped. + /// monthEvents consolidated by event month and . + /// weekconsolidated by event week ... + /// dayconsolidated by event day ... + /// hourconsolidated by event hour ... + /// + /// + [DataMember(Name = "report_type")] + public string ReportType { get; set; } = "raw"; + + /// + /// Report Scope + /// + /// ScopeDescription + /// enterpriseEnterprise + /// userLogged in user + /// + /// + [DataMember(Name = "scope")] + public string Scope { get; internal set; } = "enterprise"; + + /// + /// Sort Order + /// + /// Sort OrderDescription + /// descendingDefault + /// ascending + /// + /// + [DataMember(Name = "order")] + public string Order { get; set; } = "descending"; + + /// + /// Number of rows to return + /// + /// Maximum: 1000 - raw reports, 2000 - consolidated reports + [DataMember(Name = "limit")] + public int Limit { get; set; } = 1000; + + /// + /// Repord Filder + /// + /// + [DataMember(Name = "filter", EmitDefaultValue = false)] + public ReportFilter Filter { get; set; } + + /// + /// Aggregate columns + /// + /// ColumnDescription + /// occurrencesEvent count + /// first_createdFirst event time. MIN(Created) + /// last_createdLast event time. MAX(Created) + /// + /// + /// Consolidated reports only. + [DataMember(Name = "aggregate", EmitDefaultValue = false)] + public string[] Aggregate { get; set; } + + /// + /// Group by columns + /// + /// ColumnDescription + /// audit_event_typeEvent Type + /// usernameUsername + /// ip_addressIP Address + /// keeper_versionKeeper Client Version + /// to_usernameTarget Username + /// record_uidRecord UID + /// shared_folder_uidShared Folder UID + /// team_uidTeam UID + /// + /// + [DataMember(Name = "columns", EmitDefaultValue = false)] + public string[] Columns { get; set; } + } + + /// + /// Represents Audit Report Response + /// + [DataContract] + public class GetAuditEventReportsResponse : KeeperApiResponse + { + /// + /// Events + /// + [DataMember(Name = "audit_event_overview_report_rows")] + public List> Events { get; private set; } + } + + } + /// /// Enterprise Audit Log access methods. /// public static class AuditLogExtensions { + /// /// Gets the list of all available audit events /// diff --git a/KeeperSdk/enterprise/EnterpriseData.cs b/KeeperSdk/enterprise/EnterpriseData.cs index e9caad9..6eb8712 100644 --- a/KeeperSdk/enterprise/EnterpriseData.cs +++ b/KeeperSdk/enterprise/EnterpriseData.cs @@ -19,8 +19,6 @@ public partial class EnterpriseData : EnterpriseDataPlugin, IEnterpriseData /// /// Instantiates instance. /// - /// Keeper authentication. - /// Enterprise tree key. Optional. public EnterpriseData() { _nodes = new NodeDictionary(); diff --git a/KeeperSdk/enterprise/EnterpriseDataManagement.cs b/KeeperSdk/enterprise/EnterpriseDataManagement.cs index 3f9a4c2..5d44013 100644 --- a/KeeperSdk/enterprise/EnterpriseDataManagement.cs +++ b/KeeperSdk/enterprise/EnterpriseDataManagement.cs @@ -16,7 +16,7 @@ public partial class EnterpriseData : IEnterpriseDataManagement /// Invites user to enterprise /// /// Email Address - /// Full Name + /// Optional /// Invited User public async Task InviteUser(string email, InviteUserOptions options = null) { diff --git a/KeeperSdk/enterprise/EnterpriseDoc.cs b/KeeperSdk/enterprise/EnterpriseDoc.cs index 2305356..8c766dc 100644 --- a/KeeperSdk/enterprise/EnterpriseDoc.cs +++ b/KeeperSdk/enterprise/EnterpriseDoc.cs @@ -67,3 +67,13 @@ internal class NamespaceDoc { } } +namespace KeeperSecurity.Enterprise.AuditLogCommands +{ + /// + /// Provides Audit Report Commands + /// + [CompilerGenerated] + internal class NamespaceDoc + { + } +} \ No newline at end of file diff --git a/KeeperSdk/enterprise/EnterpriseExtensions.cs b/KeeperSdk/enterprise/EnterpriseExtensions.cs index 060e1c9..ca65d63 100644 --- a/KeeperSdk/enterprise/EnterpriseExtensions.cs +++ b/KeeperSdk/enterprise/EnterpriseExtensions.cs @@ -13,7 +13,7 @@ public static class EnterpriseExtensions /// /// Toggles "Node Isolation" flag for enterprise node. /// - /// Enterprise Data. + /// Enterprise Data. /// Node ID /// Awaitable Task public static async Task SetRestrictVisibility(this EnterpriseData enterpriseData, long nodeId) @@ -34,7 +34,7 @@ public static async Task SetRestrictVisibility(this EnterpriseData enterpriseDat /// /// Creates Enterprise Node /// - /// Enterprise Data + /// Enterprise Data /// Node Name /// Parent Node /// Awaitable task returning created node @@ -72,7 +72,7 @@ public static async Task CreateNode(this EnterpriseData enterpri /// /// Updates existing node /// - /// Enterprise Data + /// Enterprise Data /// Enterprise node /// New Parent Node /// Awaitable task @@ -96,7 +96,7 @@ public static async Task UpdateNode(this EnterpriseData enterpriseData, Enterpri /// /// Deletes existing node /// - /// Enterprise Data + /// Enterprise Data /// Node ID to be deleted /// Awaitable task public static async Task DeleteNode(this EnterpriseData enterpriseData, long nodeId) diff --git a/KeeperSdk/enterprise/EnterpriseLoader.cs b/KeeperSdk/enterprise/EnterpriseLoader.cs index ae448fa..e7921c6 100644 --- a/KeeperSdk/enterprise/EnterpriseLoader.cs +++ b/KeeperSdk/enterprise/EnterpriseLoader.cs @@ -50,7 +50,6 @@ public class EnterpriseLoader : IEnterpriseLoader /// /// Keeper Authentication /// Enterprise data plugins - /// Enterprise tree key. Optional. /// /// /// diff --git a/KeeperSdk/enterprise/EnterpriseTypes.cs b/KeeperSdk/enterprise/EnterpriseTypes.cs index e1d6040..72ce261 100644 --- a/KeeperSdk/enterprise/EnterpriseTypes.cs +++ b/KeeperSdk/enterprise/EnterpriseTypes.cs @@ -64,7 +64,6 @@ public class AccountTransferResult /// /// Defines methods for modifying enterprise users and teams. /// - /// public interface IEnterpriseDataManagement { /// @@ -111,13 +110,15 @@ public interface IEnterpriseDataManagement /// /// Deletes Enterprise Team. /// - /// Enterprise Team + /// Team UID /// Task Task DeleteTeam(string teamUid); /// /// Adds Users to Team. /// + /// Emails /// Team Uid + /// (Optional) /// Task Task AddUsersToTeams(string[] emails, string[] teamUids, Action warnings = null); /// diff --git a/KeeperSdk/utils/JsonUtils.cs b/KeeperSdk/utils/JsonUtils.cs index 4cf298f..1214c7b 100644 --- a/KeeperSdk/utils/JsonUtils.cs +++ b/KeeperSdk/utils/JsonUtils.cs @@ -38,6 +38,7 @@ public static T ParseJson(byte[] json) /// /// Type of JSON object. /// JSON object. + /// Pretty print /// JSON data. public static byte[] DumpJson(T obj, bool indent = true) { diff --git a/KeeperSdk/vault/Storage.cs b/KeeperSdk/vault/Storage.cs index 5bb9d88..3e61309 100644 --- a/KeeperSdk/vault/Storage.cs +++ b/KeeperSdk/vault/Storage.cs @@ -373,7 +373,7 @@ public interface IPredicateStorage where T : IUidLink /// /// Delete all links for object entity UID /// - /// List of Object UIDs to delete. + /// List of Object UIDs to delete. void DeleteLinksForObjects(IEnumerable objectUids); /// /// Gets all entity links for subject entity UID. diff --git a/KeeperSdk/vault/VaultTypes.cs b/KeeperSdk/vault/VaultTypes.cs index ab02d86..9a1b2ed 100644 --- a/KeeperSdk/vault/VaultTypes.cs +++ b/KeeperSdk/vault/VaultTypes.cs @@ -208,6 +208,7 @@ public interface IVaultUi /// public class NoActiveShareWithUserException : Authentication.KeeperApiException { + /// public NoActiveShareWithUserException(string username, string code, string message) : base(code, message) { Username = username; @@ -300,7 +301,7 @@ public interface IVault : IVaultData /// Parent Folder UID. /// Shared Folder creation options. Optional. /// A task returning created folder. - /// Pass parameter to create a Shared Folder. + /// Pass sharedFolderOptions parameter to create a Shared Folder. /// /// Task CreateFolder(string name, string parentFolderUid = null, SharedFolderOptions sharedFolderOptions = null); @@ -410,12 +411,16 @@ public interface IVault : IVaultData Task RevokeShareFromUser(string recordUid, string username); } + /// + /// Define methods for Keeper Secret Maneger (KSM) + /// public interface ISecretManager { /// /// Gets Keeper Secret Manager Application Details /// /// Application UID. + /// Force reloading /// Secret Manager Application Info Task GetSecretManagerApplication(string applicationUid, bool force = true); @@ -485,7 +490,7 @@ public interface IVaultSharedFolder /// /// Shared Folder UID. /// User email or Team UID. - /// Type of parameter. + /// Type of userId parameter. /// Shared Folder User Permissions. /// Awaitable task. /// @@ -500,7 +505,7 @@ public interface IVaultSharedFolder /// /// Shared Folder UID. /// User email or Team UID. - /// Type of parameter. + /// Type of userId parameter. /// Awaitable task. /// Task RemoveUserFromSharedFolder(string sharedFolderUid, string userId, UserType userType); diff --git a/Sample/Program.cs b/Sample/Program.cs index 6496c95..9898b03 100644 --- a/Sample/Program.cs +++ b/Sample/Program.cs @@ -25,6 +25,7 @@ namespace Sample { + public class AuthSyncCallback : IAuthSyncCallback { private readonly Action _onNextStep;