<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[statUP - Medium]]></title>
        <description><![CDATA[statUP is a skill tracking app for youth sports. Athletes take tests, earn stats and track improvement. We are a team of coaches, developers, designers and investors that all share in our mission to help athletes reach their dreams. - Medium]]></description>
        <link>https://medium.com/statup?source=rss----76238eb1fff6---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>statUP - Medium</title>
            <link>https://medium.com/statup?source=rss----76238eb1fff6---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 09:43:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/statup" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[In Defense of Interviews and Test Projects for Agile Developers: Rebuttals (part 2 of 3)]]></title>
            <link>https://medium.com/statup/in-defense-of-interviews-and-test-projects-for-agile-developers-rebuttals-part-2-of-3-9a2c0e391f70?source=rss----76238eb1fff6---4</link>
            <guid isPermaLink="false">https://medium.com/p/9a2c0e391f70</guid>
            <category><![CDATA[technical-interview]]></category>
            <category><![CDATA[job-interview]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[job-hunting]]></category>
            <category><![CDATA[agile]]></category>
            <dc:creator><![CDATA[Isaiah McPeak]]></dc:creator>
            <pubDate>Wed, 05 Jul 2017 15:59:02 GMT</pubDate>
            <atom:updated>2017-07-05T15:59:01.088Z</atom:updated>
            <content:encoded><![CDATA[<p><em>This article is part 2 of three in our Interview series. </em><a href="https://medium.com/statup/in-defense-of-interviews-and-test-projects-for-agile-developers-jobs-part-1-of-3-916d8719df43"><em>Read part 1 here »</em></a></p><p>There are <em>definitely </em>abuses out there, but I don’t think hiring comes down to “can you code?” That question doesn’t answer this one: are you best as a cog in a machine or a thinking partner in a business? If the latter, there’s a subjective and emotional side to the process.</p><p>And some businesses want one, some the other. You should know which you’re interviewing for and expect them to want to sort it out. Setting expectations is one of the most important aspects of running a business, and interviews are the best time to do it! Just a few expectations worth digging into:</p><ul><li>Whether <em>time spent </em>or <em>deliverables </em>or <em>both </em>are the primary expectations of how work gets done.</li><li>Level of autonomy expected/desired in employees and how they can tell.</li><li>How competing priorities are managed.</li><li>Training on the job vs. training prior to the job/on own time.</li><li>How hard it is to work here.</li><li>Expectations of balancing speed with cost and quality: which are non-negotiable and which ship with “good enough”?</li><li>Team size and relative decision-making power per person a team.</li><li>Whether raises are a negotiation (rewarding extroversion?) or a standard process.</li><li>Work hours, dress, flexibility, and what all that really means.</li></ul><p>We’ve chosen a pretty specific three-step hiring process at <a href="https://medium.com/u/355a61f3a95c">statUP</a>, which I’ll describe in part 3 of this series on acing an interview processes like ours.</p><p>Here’s a brief review of some recent complaints. One of my favorite pieces, which is less bash-y, <a href="https://www.wired.com/2015/04/hire-like-google/">is this 2015 piece by Google’s People Operations leader</a>, where he recants on silly/famous interview puzzle questions. But I want to focus on something more representative of current trends.</p><p>An HR consultant here in Austin recently shared this article in the <a href="https://www.nytimes.com/2017/04/08/opinion/sunday/the-utter-uselessness-of-job-interviews.html?mwrsm=LinkedIn">New York Times</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kpAhyIt6Dt3PDqm9." /></figure><p>The article showcases some silly interviewing assumptions and practices, then looks at some of the research on interviews. The author concludes that “interviewers typically form strong but unwarranted impressions about interviewees, often revealing more about themselves than the candidates.”</p><h3>Rebuttal #1: Creative Work is Not College</h3><p>I have three responses to the article above.</p><h4><strong>1. Same Facts, Different Conclusion</strong></h4><p>The part about interviewers revealing more about themselves is <em>exactly</em> one of the key purposes of an interview. Those interviewers will make the same mistakes as managers and teammates! Good time to figure it out.</p><h4><strong>2. Treats Jobs as Cogs</strong></h4><p>The thinking on hiring here is pretty typical, but makes extremely binary assumptions about what it’s like to work somewhere. Predictable work is handling the same customer service inquiry at Chase bank 50 times a day, or taking up the latest tech changes to a government’s internal information system — “can you do it or not” <em>is </em>the right question, because the “job” is predictable. In the 21st Century digital space, jobs are characterized</p><h4><strong>3. Academia is <em>not </em>like a Digital Job</strong></h4><p>The author’s research and examples primarily deal with college interviews and GPAs as predictors of success. What if you applied to college <em>as a team </em>that would go through university together? Would you merely select teammates by their high school test scores? No, you’d build a team that is different from another team that has just as much chance of success. What if you <em>had to outwit the other teams</em> (participate in a competitive market)? You’d spend even more time getting your team right for the style and people on it. College is <em>not like a job at an agile business!</em></p><p>Interviews have a huge advantage: see how someone thinks. Because in a digital world of creative work, <em>how </em>you work and think is just as important as your ability to push code. Unless that’s all you want to do… graphic designers have learned to have a distaste for what they call “pixel pushing,” and the same is true for developers doing things besides maintaining ticketing systems for the U.S. Government.</p><h3>Rebuttal #2: Embrace that First Impressions Matter</h3><p>In communications, we should not expect the entire world to become like us just to hear what we have to say. Instead, we must think through an audience’s mindset and communicate through their perspective. Demanding that interviewers ignore their first impressions seems too demanding on the one hand, and kind of silly on the other. Train the “first impressions interviewing” habits away, yet the root causes remain outside of interviewing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*SBu7tBLvfePRvAbTMh3Hew.png" /><figcaption>Like I said, interviews are one the best times to get to know someone. ;)</figcaption></figure><p>First impressions certainly make a difference, but any first impression may also be overcome. A company that values extroversion and loud, opinionated statements (fingernails on a chalkboard to me!) will still be in awe when the quiet person suddenly demonstrates some irrefutable skill. Because humans have <em>all kinds of psychological biases</em>, not just first impressions, you can trigger another one: rooting for underdogs is one you can go for after a poor first impression.</p><p>Does it seem unjust for first impressions to matter so much? Yes, of course. Any savvy Redditor is going to easily find ways to be indignant at almost every interview. “Can they do the job or not?”</p><p>While Reddit might want to explode at some phrase an interviewer says, <em>training </em>that out of the interviewer in an interview-only setting merely ensures the behavior hides itself until after you’ve signed the dotted line. I guess I’m saying that while we should always be maturing, we shouldn’t be removing our humanity from one aspect of a process and expect the rest to magically fall into place.</p><h3>Rebuttal #3: Interviews aren’t “hire/no-hire” moments</h3><p>They’re more than that! Expectation setting, mutual evaluation, team composition stuff, and more. Here’s one really simple illustration: the call setup for long-distance interviews.</p><p>When we interview people over the internet, there’s always the Skype/Google Hangout/whatever interoperability issues. Maybe it’s that a developer doesn’t know how to use a computer (I highly doubt it), or maybe Google Chrome suddenly is the only browser where Google Hangouts doesn’t work today… again.</p><p>Don’t you want to see how management handles this kind of thing <em>before</em> you’re hired, not after? I’ve seen bosses scream at employees for not having internet telephony working right, when there was no chance to get it right. Far better to see whether management is flexible enough to understand that the tools of the digital age sometimes put us off schedule. Consider the following reactions I’ve heard (from consulting and seeing inside interviews at around 25 companies)</p><p><strong>Reaction 1: </strong>“Can you believe that? If someone was serious about the job, they would’ve set up a test call.” I, for one, wouldn’t want to work at this company and would really hope this person showed annoyance on the call. There is so much conflicting advice about getting a job, that I would never expect someone to “set up a test call” ahead of a job interview!</p><p><strong>Reaction 2:</strong> “Hahaha you’re a developer and struggle to get basic video calling to work?” I wouldn’t want to work at a company where managers are looking to pounce on someone and make them look bad/make self look better. Hopefully this person cannot contain themselves enough during the interview and blurts something like this out on the call so you know that you don’t want to work with them — unless you do.</p><p><strong>My Reaction Last Week: </strong>(after 10 minutes of fiddling where Skype wasn’t working, Google Hangouts didn’t, then Skype did — who knows if mic, headphone, or what issue) Candidate expresses apology and is clearly nervous, so I say “This one is on us! We’re throwing a bunch of freeware — from Slack to Skype — together to make it work. Totally not your fault. Let’s just fresh start the whole thing, ok?” If this response annoys you, then you already know we wouldn’t make great teammates :) If this response puts you at ease, then you have a little taste of what working here may be like.</p><p>Interviews help people see things that are difficult to communicate. “Do I get the job or not?” is an overly academic and simplistic way of looking at things.</p><h3>What about Test Projects?</h3><p>Companies are just trying to get free work from you! On Austin Digital Jobs (a great job board/community), I regularly see horror stories of abusive test projects that either take crazy-long and assume the employee wants so badly to work for the company that they’ll do anything, or actually cancels job posts after receiving free work! Ahhhh!</p><h4>A recent candidate used this trend on us…</h4><p>Recently at statUP we had a developer (currently out of work) refuse to do a 3–6-hour test project after dragging on for a week. He put a LOT of work into NOT doing a project and sent us a clearly advice-laden email instead. The email challenged our co-founder, Jared, on whether he had to pay anything to go to training camps to be recruited as a pro soccer player (ironically, turns out Jared had to pay a whole lot and put a bunch of skin in the game, contrary to expectation). This particular situation revealed some interesting expectations about hiring practices and how a company works.</p><p>For us, seeing how this person dealt with a simple non-statUP-related assignment is exactly why we run a test project!</p><h4><strong>Been There</strong></h4><p>As someone who poured 45+ hours into a test project (I asked for one after rejected post-interview) that landed me as first employee at a SaaS startup, I don’t have too much sympathy here.</p><p>I’ve done test projects for various hiring processes, including an extensive one for Gusto where I designed a complete feature (btw I failed this one in interview 6… but I designed something great for my portfolio! :P).</p><h4><strong>Don’t Reject for Extremes</strong></h4><p>I used to work in Government and have seen processes that would make Eric Ries weep. I remember one 19-stage, 18-month process I consulted for at a Fortune 500 company that took <em>18–20 months to complete</em>, and was characterized as “everyone could say no, but nobody could say yes.” That doesn’t mean process is bad, though. It means the discipline to keep it simple isn’t easy.</p><p>Are you thinking “he’s just appealing to his own experience”? Yes, I am. I believe trying to make your company more like a computer with its decision-making is less, not more effective. The <a href="https://smile.amazon.com/Hunch-Turn-Everyday-Insights-Thing/dp/0735214115/ref=sr_1_1?ie=UTF8&amp;qid=1496403040&amp;sr=8-1&amp;keywords=hunch+jiwa">new book Hunch</a> seems to go along with this notion. I could be super wrong here! If you don’t like this style, you probably shouldn’t want to work with me or leaders like me. That’s okay!</p><h4><strong>You Can’t Remove Decision-Making from the Process</strong></h4><p>For people looking to avoid the difficult decision-making, no method or process will do that: that is the nature of hiring. Even though double-blind interviews using endless web forms can give some appearance of objectivity, <em>a company and its culture don’t operate that way</em>.</p><p>Actually, not entirely true… there <em>are </em>companies that operate that way: Department of Homeland Security, HP, CSC, etc… if you’re looking for giant processes to attempt to bake in objectivity, there are companies that attempt to operate that way. Never mind that their executives change roles every 2–3 years, often care more about the Rolex and title than the work, and lay off 7,000 people at a time. The computer (I mean, “data”) told them to!</p><p>Test projects show you a little about how someone problem-solves and communicates. Test projects also help a candidate see if these are the kind of people that working with will be a good experience. Next week I’ll share what we’re looking for when we run a test project, with some tips for success.</p><h3>Cog in Machine vs. Thinking Partner of Business</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*Im36hErRBUt8Ff26." /></figure><p>Still anti-interviews? That’s okay. I think you may be more comfortable at a large corporation where you can just pick up the next ticket, do it, and call it a day. Or maybe there’s a small business with a culture pretty different from ours that’s perfect for you!</p><p>At <a href="https://medium.com/u/355a61f3a95c">statUP</a>, we want each developer to understand the business — so we do role-swapping for demo days (you might demo a marketer’s work this week), take shifts at technical support, and spend a lot of time understanding the entire goals and customers of the business.</p><p>Whether you’ll even care about that is worth exploring beforehand.</p><p>The digital world is <em>creative space,</em> not moving pile of dirt to from place A to place B. It’s also not an assembly line building the same Toyota Prius a thousand times. The work is largely undefined until someone defines part of it a week before, and the rest as you go. Developers can serve that process, or shape that process — and <em>either way </em>is an efficient method of running a company. Put another way: at our company, you’d be expected to help identify why the dirt is moving from A to B and possibly suggesting C, or in the <em>design </em>office of Toyota’s next vehicle.</p><h3>Conclusion</h3><p>Creative work can go at different speeds and ideas can collide based on “soft” factors such as likability, team feel, random learning, pride, shared joy, likability, and communication. If these things can make the difference, then they’re worth the time spent finding a fit.</p><p>Enough arguing!</p><p>See you next week for the final article in this series and how to ace an interview process like ours!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a2c0e391f70" width="1" height="1" alt=""><hr><p><a href="https://medium.com/statup/in-defense-of-interviews-and-test-projects-for-agile-developers-rebuttals-part-2-of-3-9a2c0e391f70">In Defense of Interviews and Test Projects for Agile Developers: Rebuttals (part 2 of 3)</a> was originally published in <a href="https://medium.com/statup">statUP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In Defense of Interviews and Test Projects for Agile Developers: Jobs (part 1 of 3)]]></title>
            <link>https://medium.com/statup/in-defense-of-interviews-and-test-projects-for-agile-developers-jobs-part-1-of-3-916d8719df43?source=rss----76238eb1fff6---4</link>
            <guid isPermaLink="false">https://medium.com/p/916d8719df43</guid>
            <category><![CDATA[work-smarter]]></category>
            <category><![CDATA[startup-lessons]]></category>
            <category><![CDATA[interview-tips]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[job-interview]]></category>
            <dc:creator><![CDATA[Isaiah McPeak]]></dc:creator>
            <pubDate>Thu, 15 Jun 2017 13:55:58 GMT</pubDate>
            <atom:updated>2017-06-15T13:55:58.312Z</atom:updated>
            <content:encoded><![CDATA[<p>There’s a recent trend to bash interviews and test projects in hiring for developers. Critics argue something like “it all comes down to this: can you code?” That prompted some internal debate, and these three articles are the result aimed at you — the developer who wants to work at good companies on great projects and maybe isn’t sure what to think about hiring practices.</p><p>For this first post, we look at something I find missing in many candidates: a philosophical understanding of what “a job” is, how it is created, and why.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*wEmhqNMSozTk04lc7g-x1g.png" /><figcaption>Interviews are good. But maybe not like à la Step Brothers</figcaption></figure><p>(In part 2, we’ll consider rebuttals to some of the hype against interviews and test projects. In part 3, we’ll take an in-depth look at a three-stage hiring process with tips on how to ace it and what you’re looking for.)</p><p>I hope that developers find these posts helpful guides to greater savviness in the hiring market.</p><h3>Foundation: What is a job?</h3><p>A job is an exchange of effort that ought to lead to more revenue than it costs to pay you for that effort. Finding an applicant who “gets” this core bargain seems difficult for some reason. But if you understand that your impact needs to be greater than your cost, you’ll be thinking of yourself as a business. And that’s what a job is.</p><p>I remember the day this clicked for me. I was 23 and trying to learn how financial statements work, while doing some analyst research on competitors. Publicly traded companies report a fascinating number called “Revenue Per Employee.” I thought “I wonder how much revenue I contribute to…”. From that day forward, I changed the language I had around jobs and viewed making a job posting as planning that an investment of cash leads to a potential return of greater value. That’s a basic business exchange.</p><p>Some companies that have high-impact employees get numbers like $250,000 per employee (or over a million if you’re a <a href="http://www.businessinsider.com/top-tech-companies-revenue-per-employee-2015-10">Google or Apple</a>).</p><p>And suddenly, executives took me more seriously. At age 24, I ended up leading business units and had a seat in the C-Suite. Much of that came from seeing through the executive perspective a little earlier than some get a chance. Today, I still recommend resumes or cover letters say something like “I’ll work to have greater financial impact than my cost!” That person “just gets it,” even when in a creative role.</p><p>Does that feel gross, as a creative worker? It shouldn’t. Think of it as the same “grossness” that is why the Behavioral Design movement is taking off. Rather than designing software to fight human behavior, get over that humans behave like humans and work within that construct. As much as I value creative work for its ends, this advice holds true: associate yourself with revenue to be invaluable at a business.</p><p>If that sounds foreign, here are some tips:</p><ul><li>Try and work on customer-centric features that customers want to pay for or are already paying for, etc.</li><li>Try and develop relationships in your company with the people who speak to customers (like product managers).</li><li>Regularly ask, in a non-challenging way, about what the market is willing to pay for or how well the customer need is understood.</li><li>As you build your resume, don’t just put shipped product X times a month to Y number of users, but throw in for Z dollars (especially great if there’s a before/after increase that in which you played a part).</li></ul><h3>When is a “Position” Created?</h3><p>A job opening is a <em>hypothesis</em>. Based on our what is a job section above, you can probably fill in that hypothesis: <em>hiring a human with X skills will cost something like Y and result in some greater benefit Z</em>.</p><p>In an interview, if you can get an angle on that Z, you will be far more likely to succeed. One of my favorite questions in the “what questions do you have for us?” section is something like: “Why did you create this job position? What led to it?” In sales we say “sell to pain” — and finding out the pain/trouble/overwhelmed-ness/fear that a team or management has created a position to address is huge for your ability to sell yourself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*hiJcj3heC6Rl1UrOJSdPQQ.png" /><figcaption>How not to sell yourself ;) (via Imgur)</figcaption></figure><p>And here’s a nasty warning sign, which I’ve seen heeded and ignored several times: if asking a question like the one I just suggested nets <em>contradictory explanations </em>from different interviewers, or kind of a “meh, we just need more developers,” then you already know a few things:</p><h4><strong>1. Succeeding will be challenging</strong></h4><p>If the organization isn’t certain what it wants, then how can it know whether it got it?</p><h4><strong>2. Expectations management is your #1 priority</strong></h4><p>If you do take the position, make sure you tighten up the need for your role or you will likely be simultaneously judged as success and failure by different people.</p><h4><strong>3. The role may disappear</strong></h4><p>Sometimes the role will disappear during the hiring process as <em>interviews merely catalyzed internal debate so that those in disagreement could come to agreement by being faced with a tangible choice and realizing they weren’t ready. </em>Worse, sometimes the “we didn’t really need exactly this” moment happens after your first week on the job.</p><h4><strong>4. There’s room to become a leader</strong></h4><p>When I get an ambiguous answer, I smile inside because it leads to a strength of mine: jumping into an ambiguous situation and identifying the problem we’re trying to solve in greater clarity <em>and </em>solving the problem. Most job roles are to “solve a problem,” but there’s opportunity in “we’re not sure what the problem is yet, but we just know we need something.” You can easily become essential if the organization is unsure why it’s hiring — but often, you won’t be told what to do or be measured against any clear standards. So influence and persuasion have to be some of your strengths. They are for me, but I can’t code… so you may see this situation as a 1–3 point in our list here, not an opportunity.</p><p>One last question which I learned from selling to large corporations and governments when they have huge statements of work (think job descriptions with 25–250 bullet points): “<em>which items in the job description are the most important?” </em>Answers to this question from your interviewers will likely shed a great deal of light on what they’re really after — and which person cares about what item more.</p><p>In summary, an organization <em>believes </em>that a certain type of thing is needed and creates an opening to fill the need. Can they perfectly predict what will actually address the need and how much that will cost? No. That’s why you get different salary and work expectations.</p><h3>Conclusion</h3><p>If we can agree on the basic nature of “a job,” from the business’s perspective, then I think you’ll be more open next week to considering why interviews and test projects — despite many imperfections and abuses — are one of the best ways for matching person to job.</p><p>If you found any of the above tips helpful, well… there’s more to come.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=916d8719df43" width="1" height="1" alt=""><hr><p><a href="https://medium.com/statup/in-defense-of-interviews-and-test-projects-for-agile-developers-jobs-part-1-of-3-916d8719df43">In Defense of Interviews and Test Projects for Agile Developers: Jobs (part 1 of 3)</a> was originally published in <a href="https://medium.com/statup">statUP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[statUP’s Workaround & Long-Term Solution to an AWS CORS issue]]></title>
            <link>https://medium.com/statup/statups-workaround-long-term-solution-to-an-aws-cors-issue-68d0b68555db?source=rss----76238eb1fff6---4</link>
            <guid isPermaLink="false">https://medium.com/p/68d0b68555db</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-api-gateway]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[sports-tech]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Kevin Felichko]]></dc:creator>
            <pubDate>Mon, 24 Apr 2017 16:49:45 GMT</pubDate>
            <atom:updated>2017-04-24T16:49:45.310Z</atom:updated>
            <content:encoded><![CDATA[<p>Being on the bleeding edge of serverless development has its virtues and vices. From learning and adapting to new, emerging frameworks to ignoring the red, squiggly underline thanks to spellcheck, the serverless development approach, for the most part, allows companies to focus more time on their goals and less time on operating the machines that power it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CtUpG7XZ6Ae5-PBf_Oys2g.jpeg" /><figcaption>“Serverless” isn’t accepted by spellcheck. I know I can add to my dictionary but still…</figcaption></figure><p>Amazon really sparked this new development model with the introduction of their API Gateway and Lambda services. Now, we can build applications to run on-demand, without configuring servers, and with decent speed.</p><p>statUP, a company with the mission to help athletes earn stats that matter to coaches, has been built on serverless technology. We are born of this new model, and as such, we have hit many of the early issues. One in particular deals with the API Gateway and CORS.</p><h3>Quick Background: CORS On the Internet</h3><p>CORS stands for “Cross-Origin Resource Sharing.” If CORS is enabled and someone makes a request from DomainA.com to DomainB.com, the request will be allowed. A browser checks to ensure the request is allowable.</p><p>CORS prevents hijacking requests to websites that look like yours but aren’t there. It’s a common feature on every (modern) web browser.</p><p>If you make a request and don’t have the CORS headers correct, the web browser will reject the whole thing. Looking at the debug console will tell you that you cannot make that request because it’s not allowed.</p><h3>The CORe of the issue in AWS API Gateway: Missing CORS Headers</h3><p>For the most part, the AWS API Gateway is a great service to wrap around a variety of resource types — including Lambda functions. If an application has protected resources based on the function caller, the application probably uses the custom authorizer feature of the API Gateway.</p><p>Custom authorizers act as gatekeeper. The API Gateway ties together the custom authorizer and the underlying resource. When a protected resource is called, the API Gateway will call the custom authorizer which generates a policy indicating if the call is allowed or denied. When the call is allowed, the request is forwarded to the underlying resource. Upon completion, the API Gateway will map the output to a response as determined by the API Gateway method’s integration response mappings. When the call is denied, the API Gateway will skip the forwarding and return a response, also based on the integration response mapping, back to the caller.</p><p>Since its introduction, custom authorizers and the API Gateway have had a significant limitation. For all non-200 (i.e. successful calls), the API Gateway strips away the CORS headers when sending back its response to the caller. Web applications are impacted by this since modern web-browsers will disallow access to the response without the CORS headers.</p><h3>The Problem</h3><p>With the CORS headers stripped from a 4xx HTTP response, web applications cannot determine if the user’s token has expired or if the user is not authorized to access a resource without an additional call or by scrapping the custom authorizer all together.</p><p>That header is important because the web browser looks at this 4xx response and does not recognize the source because of missing CORS. When using a framework like AngularJS, we end up with a response interceptor like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/65b3dd4427da3534479b61edb1cc72b8/href">https://medium.com/media/65b3dd4427da3534479b61edb1cc72b8/href</a></iframe><p>Every non-200 status that comes back has a status of -1. This is useless.</p><p>We cannot tell whether the person was rejected because: a) The user didn’t have the right permission, or b) The user’s session expired. And without that context, we’re not sure what to do: automatically log out the user, show error messages, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*tGVVdyL-qgZd0JbtgDS27A.png" /><figcaption>It’s not pretty — not even its mother could love it.</figcaption></figure><p>Instead of being redirected when a token has expired, the user gets a bunch of error messages on the screen prompting the user to log out and then log back in. This is a subpar user experience which causes the user to conclude the site is broken.</p><h3>The Workaround</h3><p>After some trial and error…</p><p>We modified our custom authorizer to <em>never</em> deny access to a protected resource. Instead, we always allow the request and provide our own custom context via the context property of the policy statement. To keep it simple, we set two properties:</p><ul><li>Has the caller’s token expired? True/False</li><li>Was the caller authorized to access this resource? True/False</li></ul><p>When the caller accesses a protected resource, we run through a token check followed by our authorization logic. The outcome is then converted to an AWS policy statement with our custom context added:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2363cdd9908a6c01d3a7f57917a9d926/href">https://medium.com/media/2363cdd9908a6c01d3a7f57917a9d926/href</a></iframe><p>Previously, if the custom authorizer sent back a deny statement, the API Gateway would end the request and send back the appropriate HTTP response minus the all important CORS headers. With this change to the custom authorizer, just setting the context property is not enough since the API Gateway has no idea what it means.</p><h3>Updating the API Gateway</h3><p>We need to move the enforcement of authentication and authorization to our Lambda functions which will make use of this new context property.</p><p>Before we can update the Lambda functions, we have to update the API Gateway method’s integration request mapping to passthrough the context properties we need for enforcement:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4741ce3984fb36cb224750492ec59ce1/href">https://medium.com/media/4741ce3984fb36cb224750492ec59ce1/href</a></iframe><p>In the AWS Console for the API Gateway, it looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y-Jrd9b0uMzj97v_HNrP_w.png" /></figure><p>By updating the integration request mappings for our protected resources, the Lambda functions will have access to the custom context properties set by the authorizer via the event object.</p><h3>Refactoring</h3><p>Next, we have to refactor our Lambda functions to look to the event object to determine how to proceed. We created a security module which serves as a wrapper around the previous Lambda function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ccdf50ecdeb1ef06608ec872f2ab0946/href">https://medium.com/media/ccdf50ecdeb1ef06608ec872f2ab0946/href</a></iframe><p>We update each Lambda function to make use of this wrapper module:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5f9b59068792b9d8d858d87a160350a/href">https://medium.com/media/d5f9b59068792b9d8d858d87a160350a/href</a></iframe><p>In our Lambda function to add an athlete to a team, the wrapper does a check on the context properties which get passed through from the custom authorizer. If not authenticated, we send back the correct status, a 401 message in this case. If the user is authenticated but doesn’t have permission to access that team, the user receives the 403 not authorized error.</p><p>Note: We are using the API Gateway integration response mappings to convert the NotAuthenticated and NotAuthorized strings to response codes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6xHlxkdH99q5Hr49WkpYtA.png" /></figure><p>We can now take that data from the custom authorizer, find out whether the user is not authorized or not authenticated, and our web app receives the correct info.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e9f4a494b0ab7240d91f44c7265d543d/href">https://medium.com/media/e9f4a494b0ab7240d91f44c7265d543d/href</a></iframe><p>If the user wasn’t authenticated, we can direct him or her to the login page.</p><p>If we find that the user is no longer/was never authorized to access that content, we can send the user back to the main application page.</p><h3>Is the workaround a better solution?</h3><p>This workaround addresses a current API Gateway limitation but may also serve as a superior long-term solution even after AWS addresses the CORS header issue on non-200 responses.</p><p>With this approach, we can have CloudWatch log entries retain all the context per function call. This is in addition to keeping CloudWatch Logs associated with the custom authorizer itself. In the event of an unexpected Lambda error, we no longer have to cross-reference the custom authorizer logs or perform additional lookups of supporting data.</p><p>At statUP, we use CloudWatch Log subscriptions and SNS to provide proactive customer support. This additional context within our Lambda function logs makes using CloudWatch Log subscription filters a better experience since we can look for the same output pattern among all protected functions.</p><h3>Other Potential Uses</h3><p>One feature this workaround can help with an impersonation system. For example, if a customer support representative wanted to witness what a user’s experience was like, the custom authorizer could set the principal to the impersonated user while passing in the additional impersonation details via the context object. The security module can log the impersonation details and avoid triggering the subscription filters previously set on the CloudWatch logs.</p><p>By using a wrapper module, a wrapped Lambda function can run within an execution context that is relevant based on the custom authorizer context. Continuing with the impersonation example, the security wrapper could detect that impersonation is happening and change the database layer via an IoC pattern to prevent data from being persisted without consent.</p><h3>Conclusion</h3><p>Workarounds are a big part of working with cutting-edge technologies. Thankfully, we are a part of a community with enthusiastic techies looking to solve problems and evolve the technology. We plan to share what we find along our serverless journey, and we hope you choose to do the same.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68d0b68555db" width="1" height="1" alt=""><hr><p><a href="https://medium.com/statup/statups-workaround-long-term-solution-to-an-aws-cors-issue-68d0b68555db">statUP’s Workaround &amp; Long-Term Solution to an AWS CORS issue</a> was originally published in <a href="https://medium.com/statup">statUP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>