HNHacker News
TopNewBestAskShowJobs

sjroot

1,397 karma · joined March 15, 2015

I am a software engineer currently living in New York City.

My posts and comments do not reflect the views of my employer.

submissionscomments
sjroot··on Understanding OAuth2 and OpenID Connect
Nice, good luck! My advice would be to offer something very opinionated to limit the chance that something is rolled out incorrectly. That and preventing lock-in are two big requirements IMO.

I’m doing something somewhat similar, happy to exchange notes.

sjroot··on Understanding OAuth2 and OpenID Connect
> That’s what Oauth is though.

Splitting hairs but no, Oauth has nothing to do with authentication. An introductory article like this should address the distinction between authentication and authorization in the first section IMO.

sjroot··on Understanding OAuth2 and OpenID Connect
The implicit grant returns an access token directly upon authorization being granted. By removing the additional network request, it can make your system vulnerable via manipulation of redirect URLs. if you’re implementing an OAuth 2 server, you can address this by validating the provided redirect URLs, but you should be doing that regardless.

My advice is to just always use the auth code grant with the PKCE extension. TLDR of that extension:

1) client generates a “secret key” that it sends with the authorization request. 2) server associates that key with the authorization code it returns to the authorized client 3) client must present that key again in order to exchange the authorization code for the access token.

Prevents the authorization code from being intercepted and abused.

sjroot··on Understanding OAuth2 and OpenID Connect
Are you implementing OAuth 2 or interested in learning more? I would highly recommend combing through the OAuth 2.1 spec [1] as it incorporates the “best practices” that were added to 2.0 through additional RFCs.

[1] https://tools.ietf.org/html/draft-ietf-oauth-v2-1-00

sjroot··on Microsoft backs Epic in court filing
Correct. Sorry that wasn’t clear!
sjroot··on Microsoft backs Epic in court filing
For context, the Microsoft Store platform takes a 5% fee compared to Apple’s 30%. https://blogs.windows.com/windowsdeveloper/2018/05/07/a-new-...

This isn’t super surprising. Microsoft is desperate to get people to develop for the Windows platform and this obviously an incentive that developers will find attractive.

sjroot··on Show HN: My notes on Working with Go
Agreed! In my situation, lots of developers were porting Java APIs to go. They essentially had to be rewritten twice:

1st way: the way our Java devs thought Go was “supposed” to be written

2nd way: how Go should probably actually be written

By embracing the simplicity and Go’s opinionatedness the first time around, you’ll save yourself a lot of refactoring headache later.

sjroot··on Show HN: My notes on Working with Go
Ah, that would make sense. But then I'd have to dip into my jar of opinions on gRPC + Protobufs...

TLDR: Before going down that route, you should make sure you really REALLY need them. Someone learning Go for the first time probably doesn't.

sjroot··on Show HN: My notes on Working with Go
I typically use strings for enum values as well.
sjroot··on Show HN: My notes on Working with Go
First off, I should clarify that I'd actually love to see Go add support for proper enums, as I've certainly found it lacking.

My biggest issues would be maintainability and, as you mentioned, using global maps. If your enum itself is not a string value, but you NEED a string representation, then it should just implement `Stringer`.

As far as maintainability:

- The naming convention used here is not consistent with how enums are named in Go. For a good example, see the HTTP package, specifically request methods and response status codes [1]. Really, it isn't even an appropriate naming convention for constant values in any language, with `UPPERCASE_UPPERCASE_minor_note`, it looks a bit silly and took longer for me to grok.

- What if I want to add a new enum variant? I seriously have to add it to three different places? If I start touching this map in places outside the original source file, things will get really ugly really fast.

- A bit nit-picky, but: why use an `int32` here?

This file, in my opinion, is over-engineered. Go code should be simple; many people learning Go for the first time hesitate to work that way, unfortunately.

Other common issues I see with people learning Go for the first time:

- Overuse of concurrency. People like to use the `go` statement wherever possible, and create overly-complex APIs with channels. Unless you have multiple events that need to be done in parallel, yet simultaneously needing to communicate between them, you should not use them in your package's public API. Let your package consumers choose when to make that call.

- Package structure, particularly in modules. People like `src` directories, but Go doesn't work that way. Your top priority as someone learning Go should be to dig through Go's standard library itself and see how it is organized.

[1] https://golang.org/pkg/net/http/#pkg-constants

sjroot··on Show HN: My notes on Working with Go
If no one has by EOD today, I will! Good idea. :)
sjroot··on Show HN: My notes on Working with Go
Please try to contribute something actually relevant to the post.
sjroot··on Show HN: My notes on Working with Go
Warning: opinions inbound

I clicked one part (enums) and noticed a pretty glaring issue. The way you are doing enums is really _not_ conventional Go code and probably not something I would allow past a PR review. I’m saying this as someone who has built many production systems with Go and taught it to many devs coming from Java.

This guide is more in-line with how Go enums should be designed: https://blog.learngoprogramming.com/golang-const-type-enums-...

So, while I dig a little further, I think it’s fair to warn people to take this with a grain of salt. Use the language yourself and come to your own conclusions as OP did.

sjroot··on Finding vulnerable Twitter accounts with expired domains
If you deliver email to a customer and you notice that it bounces, any account security flows requiring access to that email should be disabled. Additionally, you should never show the full email address or phone number that is being used for an auth challenge. Nonetheless, those defenses will eventually be compromised.

Beyond that, it is not a company problem IMO. One of the most common uses for custom domains is custom email addresses. If a website prevented me from using it, as you propose, I would be flabbergasted.

sjroot··on Uber CEO says its service will probably shut down temporarily in California
Sounds like a great outcome for the people who are relying on that work for income right now.
sjroot··on The case for why Google should be regulated as a public utility
DDG, Yahoo, Bing, are all valid alternatives. Why does Google get screwed after the enormous investment they made (with time and money) to index pages on the internet?
sjroot··on The case for why Google should be regulated as a public utility
Bingo. Every device that I can think of allows you to choose a default search engine. It would be very easy for me to use something other than Google; they have no anticompetitive hold on how I explore the Internet and discover new services.

This article is written by someone who would personally profit from Google’s regulation. It’s an ad for his company disguised as virtue signaling.

sjroot··on Apple’s ad network gets ‘preferential access to users’ data’ vs Facebook, Google
Apple may be certainly far from perfect when it comes to favoring their own software, but to say the company as a whole is aggressively "anti-user" is just hogwash.

Updates they have made to Safari, the App Store, and iOS generally have made millions of people more conscious of how applications they use every day consume and interact with their personal information. They've inspired other companies like Google to follow suit, and are having a huge impact on the targeted advertising industry.

Give credit where it is due.

sjroot··on Rome: A Linter for JavaScript and TypeScript
That’s the same question I had when I read your comment!
sjroot··on Facebook removes QAnon conspiracy group with 200k members
No....no they shouldn't. I'd rather that responsibility fall on parents and teachers.
sjroot··on Facebook removes QAnon conspiracy group with 200k members
> Ah, so Facebook has no moral obligation to control posts on whether or not they are true - just on whether or not they get paid to show them?

To sum it up like that reduces both the enormity and complexity of the problem they are faced with. You say you get spammed with Trump ads; how many of those ads make claims that you could prove are irrevocably untrue? Politicians and people designing political ads are often experts at dancing in the "gray area" of truth.

I don't think it is fair to deny the fact that Facebook takes this problem very seriously, certainly beyond what would be expected from them as far as business obligations go. (I'm even saying this as someone building a product that would compete with them.)

sjroot··on Facebook removes QAnon conspiracy group with 200k members
That’s their entire business model, so yes it is their responsibility. Their obligation is to advertisers that want to target very specific (or very broad) groups of people. If you don’t like that then close your Facebook account.
sjroot··on Facebook removes QAnon conspiracy group with 200k members
This isn't exclusive to older people, either. Regardless, it will be even more dangerous when these people reproduce and raise their children to believe this stuff.
sjroot··on Facebook removes QAnon conspiracy group with 200k members
Bingo. It is not Facebook's responsibility to determine what is fact or fiction, and it is a bit terrifying that we increasingly rely on them (and other companies in this space) to do so.

People need to understand how to question, investigate, and challenge the sources of information they consume. If we can't do that, in the US or otherwise, then we are doomed.

sjroot··on Facebook fired an employee who posted evidence of preferential treatment
This language is not exclusive to Delaware corporations, or even corporations. It is standard practice when incorporating any kind of business entity.

Source: if you look at the articles of incorporation for my solely-owned and operated LLC, you'd find an identical purpose statement.

sjroot··on Quora Bans Me for Saying the Earth Isn’t Flat
I can’t fathom how people actually use Quora when answers are often (thinly-veiled) advertisements.
sjroot··on NewPipe – ad-free, open-source Android YouTube client
I think most people get enough benefit out of YouTube to warrant the fee. But advertisements allow the platform to be available to anyone with an internet connection. Fair trade off I’d say.
sjroot··on NewPipe – ad-free, open-source Android YouTube client
Most likely. I understand the appeal of these types of applications but it really just comes off as entitled IMO. Just watch the ads to support the content creators you care about - it isn’t that hard.

I imagine this will be an unpopular opinion here though.

sjroot··on Reddit and LinkedIn apps also caught copying and pasting clipboard contents
Or Apollo if you are on iOS.
sjroot··on Show HN: Hasura Cloud: Managed GraphQL for your database and services
I was a bit startled by the price (starts at $99/mo) but man, Hasura has been an absolute joy to work with. I'd highly recommend exploring the open source version on Heroku if you haven't tried it before.

Congratulations to Hasura on the launch!

← PreviousPage 2 of 11Next →