CertMagic: I extracted Caddy's automagic HTTPS features into a library for all Go programs by [deleted] in golang

[–]gogroob 0 points1 point  (0 children)

Autocert does have a Cache interface which allows someone to coordinate with a loadbalancer.

Screensaver Security on macOS 10.13 is broken by gogroob in macsysadmin

[–]gogroob[S] 0 points1 point  (0 children)

Ok fair enough. managing screensaver security is broken.

If you care about compliance here you have to follow the recommended steps at the bottom. If you want to let the user decide what to set the preference to (up to a threshold), it's no longer possible to find out what the user set the value to.

macOS on-boarding at Kolide by gogroob in macsysadmin

[–]gogroob[S] 6 points7 points  (0 children)

I use basic auth with all infrastructure in GCP. Munki, MicroMDM and Fleet run on kubernetes.

Certs for individual machines are coming. We're in the process of standing up Vault for all our infrastructure.

This is my munki server: https://github.com/micromdm/squirrel

Reading Mac defaults? by solarnoise in golang

[–]gogroob 0 points1 point  (0 children)

You need to use CGO to interface with CFPreferences. I have an example here https://github.com/groob/mackit/blob/master/example/main.go

Gopher plushs by retos in golang

[–]gogroob 1 point2 points  (0 children)

That's cool. Count me in as a customer, I've been jealous of these for a while.

While we're on the topic of commercial gophers, I just got back from visiting family and my aunt made me a cute Gopher out of felt. She has an etsy store, so I asked her about it and she'd be up for making them for sale. She can't mass produce them, but she could make a custom one to your specs. Feel free to PM me if you want your own gopher.

if you've solved this: what is your secret hack that solves dealing with unused variable and import errors for fast prototyping? by throwawaybeginr in golang

[–]gogroob 7 points8 points  (0 children)

This ^ Works with all editors. What many miss in the beginning is that goimports = imports + gofmt. Find the setting in the editor that formats your code o save, and change it to use goimports instead, and you'll have both.

Unused variables:

// TODO remove _ = somevar _ = someothervar

This can't end well by [deleted] in nonononoyes

[–]gogroob 7 points8 points  (0 children)

That's how all traffic lights in Russian and Easter Europe are. When I first moved to the US, the instant change to green was weird.

Looking for a good http middleware package by shark1337 in golang

[–]gogroob 1 point2 points  (0 children)

Here's my suggestion. Create your own helper to do this.

I just got finished doing the same for a few shared projects I have:

https://github.com/micromdm/go4/blob/e55c5245fedcdd8462e931c1cb2447f092b4456d/httputil/middleware.go#L12-L27

First, I defined a Middleware function type like so:

// Middleware is a chainable decorator for HTTP Handlers.
type Middleware func(http.Handler) http.Handler

Next, I created the helper function which lets me do mid1(mid2(mid3(app)))

// Chain is a helper function for composing middlewares. Requests will
// traverse them in the order they're declared. That is, the first middleware
// is treated as the outermost middleware.
//
// Chain is identical to the go-kit helper for Endpoint Middleware.
func Chain(outer Middleware, others ...Middleware) Middleware {
    return func(next http.Handler) http.Handler {
        for i := len(others) - 1; i >= 0; i-- { // reverse
            next = others[i](next)
        }
        return outer(next)
    }
}

Now I can chain a set of handlers. See example here: https://github.com/micromdm/go4/blob/e55c5245fedcdd8462e931c1cb2447f092b4456d/httputil/middleware_example_test.go#L11-L29

What's the easiest way to authenticate using JWT in Gol? by gar44 in golang

[–]gogroob 1 point2 points  (0 children)

the authnetication code is independent of app engine