Skip to content

Commit

Permalink
Make some identity session methods have public access (#146)
Browse files Browse the repository at this point in the history
* Make CreateSessionKey, GetUserSessions and ValidateSession public

* Bump tdk version to 2.6.1
  • Loading branch information
lefarchi authored Jan 19, 2025
1 parent 12bb06e commit 56c7b98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Assets/Treasure/TDK/Runtime/Identity/TDK.Identity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private async Task<string> SignLoginPayload(AuthPayload payload)
return await TDKServiceLocator.GetService<TDKThirdwebService>().ActiveWallet.PersonalSign(payloadToSign);
}

private async Task CreateSessionKey(string backendWallet, List<string> callTargets, BigInteger nativeTokenLimitPerTransaction)
public async Task CreateSessionKey(string backendWallet, List<string> callTargets, BigInteger nativeTokenLimitPerTransaction)
{
var permissionStartTimestamp = (decimal)Utils.GetUnixTimeStampNow() - 60 * 60;
var permissionEndTimestamp = (decimal)(Utils.GetUnixTimeStampNow() + TDK.AppConfig.SessionDurationSec);
Expand All @@ -98,7 +98,7 @@ await TDKServiceLocator.GetService<TDKThirdwebService>().ActiveWallet.CreateSess
);
}

private async Task<List<User.Session>> GetUserSessions()
public async Task<List<User.Session>> GetUserSessions()
{
var thirdwebService = TDKServiceLocator.GetService<TDKThirdwebService>();
var activeSignersTask = thirdwebService.ActiveWallet.GetAllActiveSigners();
Expand All @@ -117,7 +117,7 @@ await TDKServiceLocator.GetService<TDKThirdwebService>().ActiveWallet.CreateSess
}).ToList();
}

private bool ValidateSession(string backendWallet, List<string> callTargets, BigInteger nativeTokenLimitPerTransaction, User.Session session)
public bool ValidateSession(string backendWallet, List<string> callTargets, BigInteger nativeTokenLimitPerTransaction, User.Session session)
{
var requestedCallTargets = callTargets.Select(callTarget => callTarget.ToLowerInvariant());
var signerApprovedTargets = session.approvedTargets.Select(approvedTarget => approvedTarget.ToLowerInvariant());
Expand Down
2 changes: 1 addition & 1 deletion Assets/Treasure/TDK/Runtime/TDKVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
public static class TDKVersion
{
public static string name = "tdk-unity";
public static string version = "2.6.0";
public static string version = "2.6.1";
}
}

0 comments on commit 56c7b98

Please sign in to comment.