public async Task SetConfiguration(IWorkContext context, IClientTokenManagerConfiguration clientTokenManagerConfiguration)
        {
            Verify.IsNotNull(nameof(clientTokenManagerConfiguration), clientTokenManagerConfiguration);

            ITokenClientActor actor = await _actorManger.CreateProxyAsync <ITokenClientActor>(context, clientTokenManagerConfiguration.TokenKey.CreateActorKey());

            await actor.SetConfiguration(context, clientTokenManagerConfiguration);
        }
Exemple #2
0
        public async Task SetAsync(IWorkContext context, IdentityPrincipal identityPrincipal)
        {
            Verify.IsNotNull(nameof(context), context);
            Verify.IsNotNull(nameof(identityPrincipal), identityPrincipal);

            IIdentityActor actor = await _actorManger.CreateProxyAsync <IIdentityActor>(context, new ActorKey(identityPrincipal.PrincipalId));

            await actor.Set(context, identityPrincipal);
        }
Exemple #3
0
        public async Task <byte[]> Decrypt(IWorkContext context, LocalCertificateKey certificateKey, byte[] data)
        {
            Verify.IsNotNull(nameof(context), context);
            Verify.IsNotNull(nameof(certificateKey), certificateKey);
            Verify.IsNotNull(nameof(data), data);

            ICertificateActor actor = await _actorManger.CreateProxyAsync <ICertificateActor>(context, certificateKey.CreateActorKey());

            return(await actor.Decrypt(context, data));
        }
        private async Task TestAccess(IActorManager manager, ActorKey actorKey, CancellationToken token)
        {
            const string firstText = "first";

            ICache cache1 = await manager.CreateProxyAsync <ICache>(_context, actorKey);

            while (!token.IsCancellationRequested)
            {
                bool test = await cache1.IsCached(firstText);

                await cache1.Add(firstText);
            }
        }