~bigbes/core-go

9833a82725b51b343e9507ab9d7baaedef9eb7b1 — Drew DeVault 1 year, 9 months ago 50396a5
server: add AnonRouter function

To expose anonymous (unauthenticated) routing to downstream core-go
users.
1 files changed, 8 insertions(+), 1 deletions(-)

M server/server.go
M server/server.go => server/server.go +8 -1
@@ 74,11 74,18 @@ func NewServer(service string, conf ini.File) *Server {
	return server
}

// Returns the chi Router being used for this sever.
// Returns the chi Router being used for this sever. All routes on this router
// require authentication.
func (server *Server) Router() chi.Router {
	return server.router
}

// Returns the chi Router being used for this sever. All routes on this server
// are unauthenticated.
func (server *Server) AnonRouter() chi.Router {
	return server.root
}

// Adds a GraphQL schema for this server. The second parameter shall be the
// list of scopes, as strings, which are supported by this schema. This
// function configures routes for the router; all middlewares must be