public async Task InvokeAsync(HttpContext context, IHtfContext htfContext, ITeamLogic teamLogic)
        {
            if (context.Request.Headers.ContainsKey(IDENTIFICATION_HEADER) && context.Request.Headers[IDENTIFICATION_HEADER].Count == 1)
            {
                var    overlordIdentification = Environment.GetEnvironmentVariable("OVERLORD_IDENTIFICATION");
                String identification         = context.Request.Headers[IDENTIFICATION_HEADER].Single();
                htfContext.Identification = identification;
                if (identification == overlordIdentification)
                {
                    htfContext.IsIdentifiedAsAdmin = true;
                }
                Guid identificationGuid = Guid.Empty;
                if (Guid.TryParse(identification.Base64Decode(), out identificationGuid))
                {
                    Team team = await teamLogic.FindTeamByIdentification(identification);

                    if (team != null)
                    {
                        htfContext.IsIdentified = true;
                        htfContext.Team         = new Common.Model.Team {
                            Id = team.Id, Name = team.Name
                        };
                    }
                }
            }
            await _next(context);
        }
Example #2
0
 public Challenge18(IHtfContext htfContext, ITeamLogic teamLogic, IChallengeLogic challengeLogic,
                    IDashboardLogic dashboardLogic, IHistoryLogic historyLogic, IMemoryCache memoryCache)
     : base(htfContext, teamLogic, challengeLogic, dashboardLogic, historyLogic)
 {
     _cache  = memoryCache;
     _client = new RestClient("https://pokeapi.co/api/v2/pokemon/");
 }
Example #3
0
 public Challenge13(IHtfContext htfContext, ITeamLogic teamLogic, IChallengeLogic challengeLogic,
                    IDashboardLogic dashboardLogic, IHistoryLogic historyLogic, IMemoryCache memoryCache)
     : base(htfContext, teamLogic, challengeLogic, dashboardLogic, historyLogic)
 {
     _cache  = memoryCache;
     _client = new RestClient("https://api.mapbox.com/geocoding/v5/mapbox.places/");
 }
Example #4
0
 public Challenge10(IHtfContext htfContext, ITeamLogic teamLogic, IChallengeLogic challengeLogic,
                    IDashboardLogic dashboardLogic, IHistoryLogic historyLogic, IImageLogic imageLogic)
     : base(htfContext, teamLogic, challengeLogic, dashboardLogic, historyLogic)
 {
     _htfContext = htfContext;
     _imageLogic = imageLogic;
 }
Example #5
0
 public Challenge01(IHtfContext htfContext, ITeamLogic teamLogic, IChallengeLogic challengeLogic,
                    IDashboardLogic dashboardLogic, IHistoryLogic historyLogic)
     : base(htfContext, teamLogic, challengeLogic, dashboardLogic, historyLogic)
 {
     _historyLogic   = historyLogic;
     _teamLogic      = teamLogic;
     _challengeLogic = challengeLogic;
 }
 public AccountInfoController(IAccountLogic l, ITeamLogic t, IActivityLogic a, IAttainmentLogic attainment, IBadgeLogic badge)
 {
     logic           = l;
     tLogic          = t;
     ActivityLogic   = a;
     BadgeLogic      = badge;
     AttainmentLogic = attainment;
 }
 public AccountInfoController(IAccountLogic l, ITeamLogic t, IActivityLogic a, IAttainmentLogic attainment, IBadgeLogic badge)
 {
     logic = l;
     tLogic = t;
     ActivityLogic = a;
     BadgeLogic = badge;
     AttainmentLogic = attainment;
 }
 public AttainmentLogic(IUnitOfWork unit, IAttainmentRepository repo, IBadgeRepository b, IActivityRepository a, ITargetRepository t, ITeamLogic teamLogic)
 {
     this.Unit = unit;
     this.Repo = repo;
     this.bRepo = b;
     this.actRepo = a;
     this.tRepo = t;
     this.teamLogic = teamLogic;
 }
 public AttainmentLogic(IUnitOfWork unit, IAttainmentRepository repo, IBadgeRepository b, IActivityRepository a, ITargetRepository t, ITeamLogic teamLogic)
 {
     this.Unit      = unit;
     this.Repo      = repo;
     this.bRepo     = b;
     this.actRepo   = a;
     this.tRepo     = t;
     this.teamLogic = teamLogic;
 }
Example #10
0
 protected ChallengeBase(
     IHtfContext htfContext,
     ITeamLogic teamLogic, IChallengeLogic challengeLogic, IDashboardLogic dashboardLogic, IHistoryLogic historyLogic)
 {
     _htfContext     = htfContext;
     _teamLogic      = teamLogic;
     _challengeLogic = challengeLogic;
     _dashboardLogic = dashboardLogic;
     _historyLogic   = historyLogic;
 }
Example #11
0
 public ChallengeEngine(IHtfContext context, ITeamLogic teamLogic, IChallengeLogic challengeLogic,
                        IChallenge01 challenge01, IChallenge02 challenge02, IChallenge03 challenge03, IChallenge04 challenge04, IChallenge05 challenge05,
                        IChallenge06 challenge06, IChallenge07 challenge07, IChallenge08 challenge08, IChallenge09 challenge09, IChallenge10 challenge10,
                        IChallenge11 challenge11, IChallenge12 challenge12, IChallenge13 challenge13, IChallenge14 challenge14, IChallenge15 challenge15,
                        IChallenge16 challenge16, IChallenge17 challenge17, IChallenge18 challenge18, IChallenge19 challenge19, IChallenge20 challenge20)
 {
     _context          = context;
     _teamLogic        = teamLogic;
     _challengeLogic   = challengeLogic;
     _challengeLibrary = new Dictionary <Identifier, IChallenge>
     {
         { Identifier.Challenge01, challenge01 }, { Identifier.Challenge02, challenge02 },
         { Identifier.Challenge03, challenge03 }, { Identifier.Challenge04, challenge04 },
         { Identifier.Challenge05, challenge05 }, { Identifier.Challenge06, challenge06 },
         { Identifier.Challenge07, challenge07 }, { Identifier.Challenge08, challenge08 },
         { Identifier.Challenge09, challenge09 }, { Identifier.Challenge10, challenge10 },
         { Identifier.Challenge11, challenge11 }, { Identifier.Challenge12, challenge12 },
         { Identifier.Challenge13, challenge13 }, { Identifier.Challenge14, challenge14 },
         { Identifier.Challenge15, challenge15 }, { Identifier.Challenge16, challenge16 },
         { Identifier.Challenge17, challenge17 }, { Identifier.Challenge18, challenge18 },
         { Identifier.Challenge19, challenge19 }, { Identifier.Challenge20, challenge20 }
     };
 }
 public FoodLogic(IUnitOfWork unit, IFoodRepository repo, ITeamLogic teamLogic)
 {
     this.Unit = unit;
     this.Repo = repo;
     this.TeamLogic = teamLogic;
 }
 public ActivityLogic(IUnitOfWork unit, IActivityRepository repo, ITeamLogic teamLogic)
 {
     this.Unit = unit;
     this.Repo = repo;
     this.TeamLogic = teamLogic;
 }
 public MembershipController(IMembershipLogic logic, ITeamLogic tl)
 {
     Logic  = logic;
     tLogic = tl;
 }
Example #15
0
 public TeamService(IBus bus, ITeamLogic teamLogic)
 {
     _bus       = bus;
     _teamLogic = teamLogic;
 }
 public ActivityLogic(IUnitOfWork unit, IActivityRepository repo, ITeamLogic teamLogic)
 {
     this.Unit      = unit;
     this.Repo      = repo;
     this.TeamLogic = teamLogic;
 }
Example #17
0
 public DashboardController(ITeamLogic teamLogic, IDashboardLogic dashboardLogic, IHistoryLogic historyLogic)
 {
     _teamLogic      = teamLogic;
     _dashboardLogic = dashboardLogic;
     _historyLogic   = historyLogic;
 }
 public StatusLogic(IUnitOfWork unit, IStatusRepository repo, ITeamLogic teamLogic)
 {
     this.Unit      = unit;
     this.Repo      = repo;
     this.TeamLogic = teamLogic;
 }
Example #19
0
 public TeamController(ITeamLogic teamLogic)
 {
     _teamLogic = teamLogic;
 }
 public FoodLogic(IUnitOfWork unit, IFoodRepository repo, ITeamLogic teamLogic)
 {
     this.Unit      = unit;
     this.Repo      = repo;
     this.TeamLogic = teamLogic;
 }
Example #21
0
 public TeamController(ITeamLogic logic)
 {
     _logic = logic;
 }
Example #22
0
 public TeamController(ITeamLogic logic, IMembershipLogic mem)
 {
     Logic    = logic;
     MemLogic = mem;
 }
Example #23
0
 public TeamController(ILogger <ApiBaseController> logger, ITeamLogic teamLogic) : base(logger)
 {
     this.teamLogic = teamLogic;
 }
 public TeamInfoController(ITeamLogic t, IAccountLogic a, IMembershipLogic m)
 {
     logic = t;
     aLogic = a;
     MembershipLogic = m;
 }
Example #25
0
 /// <summary>
 /// CHALLENGE 08:
 /// Variable parameters
 /// </summary>
 public Challenge09(IHtfContext htfContext, ITeamLogic teamLogic, IChallengeLogic challengeLogic,
                    IDashboardLogic dashboardLogic, IHistoryLogic historyLogic)
     : base(htfContext, teamLogic, challengeLogic, dashboardLogic, historyLogic)
 {
 }
Example #26
0
 public TeamController(ITeamLogic hanlder, ILocationClient client)
 {
     logicHandler   = hanlder;
     locationClient = client;
 }
 public StatusLogic(IUnitOfWork unit, IStatusRepository repo, ITeamLogic teamLogic)
 {
     this.Unit = unit;
     this.Repo = repo;
     this.TeamLogic = teamLogic;
 }
 public TeamController(ITeamLogic logic, IMembershipLogic mem)
 {
     Logic = logic;
     MemLogic = mem;
 }
 public TeamInfoController(ITeamLogic t, IAccountLogic a, IMembershipLogic m)
 {
     logic           = t;
     aLogic          = a;
     MembershipLogic = m;
 }
 public MembershipController(IMembershipLogic logic, ITeamLogic tl)
 {
     Logic = logic;
     tLogic = tl;
 }