<commit_before>﻿using Obsidian.Application.ProcessManagement;
using Obsidian.Domain;
using Obsidian.Domain.Repositories;
using System;
using System.Linq;
using System.Threading.Tasks;
using System.IdentityModel.Tokens.Jwt;
using Microsoft.IdentityModel.Tokens;
using System.Text;

namespace Obsidian.Application.OAuth20
{
    public class OAuth20Saga : Saga,
        IStartsWith<AuthorizeCommand, AuthorizeResult>,
        IHandlerOf<SignInMessage, SignInResult>,
        IHandlerOf<PermissionGrantMessage, PermissionGrantResult>,
        IHandlerOf<AccessTokenRequestMessage, AccessTokenResult>
    {
        private readonly IClientRepository _clientRepository;
        private readonly IUserRepository _userRepository;
        private readonly IPermissionScopeRepository _scopeRepository;

        private OAuth20Status _status;

        public OAuth20Saga(IClientRepository clientRepo,
                           IUserRepository userRepo,
                           IPermissionScopeRepository scopeRepo)
        {
            _clientRepository = clientRepo;
            _userRepository = userRepo;
            _scopeRepository = scopeRepo;
        }

        protected override bool IsProcessCompleted()
        {
            throw new NotImplementedException();
        }

        public Task<AuthorizeResult> StartAsync(AuthorizeCommand command)
        {
            throw new NotImplementedException();
        }

        public bool ShouldHandle(SignInMessage message)
        {
            throw new NotImplementedException();
        }

        public Task<SignInResult> HandleAsync(SignInMessage message)
        {
            throw new NotImplementedException();
        }

        public bool ShouldHandle(PermissionGrantMessage message)
        {
            throw new NotImplementedException();
        }

        public Task<PermissionGrantResult> HandleAsync(PermissionGrantMessage message)
        {
            throw new NotImplementedException();
        }

        public bool ShouldHandle(AccessTokenRequestMessage message)
        {
            throw new NotImplementedException();
        }

        public Task<AccessTokenResult> HandleAsync(AccessTokenRequestMessage message)
        {
            throw new NotImplementedException();
        }
    }
}<commit_msg>added should handle condiction to oauth20 saga<commit_after>﻿using Obsidian.Application.ProcessManagement;
using Obsidian.Domain;
using Obsidian.Domain.Repositories;
using System;
using System.Linq;
using System.Threading.Tasks;
using System.IdentityModel.Tokens.Jwt;
using Microsoft.IdentityModel.Tokens;
using System.Text;

namespace Obsidian.Application.OAuth20
{
    public class OAuth20Saga : Saga,
        IStartsWith<AuthorizeCommand, AuthorizeResult>,
        IHandlerOf<SignInMessage, SignInResult>,
        IHandlerOf<PermissionGrantMessage, PermissionGrantResult>,
        IHandlerOf<AccessTokenRequestMessage, AccessTokenResult>
    {
        private readonly IClientRepository _clientRepository;
        private readonly IUserRepository _userRepository;
        private readonly IPermissionScopeRepository _scopeRepository;

        private OAuth20Status _status;

        public OAuth20Saga(IClientRepository clientRepo,
                           IUserRepository userRepo,
                           IPermissionScopeRepository scopeRepo)
        {
            _clientRepository = clientRepo;
            _userRepository = userRepo;
            _scopeRepository = scopeRepo;
        }

        protected override bool IsProcessCompleted()
        {
            throw new NotImplementedException();
        }

        public Task<AuthorizeResult> StartAsync(AuthorizeCommand command)
        {
            throw new NotImplementedException();
        }

        public bool ShouldHandle(SignInMessage message) => _status == OAuth20Status.RequireSignIn;

        public Task<SignInResult> HandleAsync(SignInMessage message)
        {
            throw new NotImplementedException();
        }

        public bool ShouldHandle(PermissionGrantMessage message) => _status == OAuth20Status.RequirePermissionGrant;

        public Task<PermissionGrantResult> HandleAsync(PermissionGrantMessage message)
        {
            throw new NotImplementedException();
        }

        public bool ShouldHandle(AccessTokenRequestMessage message) => _status == OAuth20Status.AuthorizationCodeGenerated;

        public Task<AccessTokenResult> HandleAsync(AccessTokenRequestMessage message)
        {
            throw new NotImplementedException();
        }
    }
}
{'fraction_non_alphanumeric': 0.05600511073253833, 'fraction_numerical': 0.005110732538330494, 'mean_word_length': 2.4741124260355027, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5388013', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1087, 'n_words': 235}