Skip to content

Instantly share code, notes, and snippets.

Ikem Okonkwo codesword

Block or report user

Report or block codesword

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View error-format.json
{
"eventTime": "ISO DateTime String",
"serviceContext": {
"service": "Kubernetes deployment name eg user",
"version": "replica set number eg 3493650161"
},
"message": "stackTrace",
"context": {
"httpRequest": {
"method": "POST",
View assign_test.go
package controllers
import (
"context"
"github.com/codesword/microservices-blog-api/pb/authorization"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Assign Controller", func() {
View blog-svc.proto
syntax = "proto3";
package blog;
import "blog/blog.proto";
import "google/api/annotations.proto";
service BlogSvc {
rpc GetPost (blog.Slug) returns (blog.Post) {
option (google.api.http).get = "/v1/posts/{slug}";
View blog.proto
syntax = "proto3";
package blog;
message Empty {}
message Id {
string id = 1;
}
View authorization-svc.proto
syntax = "proto3";
package authorization;
import "google/api/annotations.proto";
import "authorization/authorization.proto";
service AuthorizationSvc {
/* Get a single user permission
@codesword
codesword / authorization.proto
Last active Jan 22, 2018
Input and Output messages
View authorization.proto
syntax = "proto3";
package authorization;
message Empty {}
//Input object
message ID {
// Unique identifier for permissions
string id = 1;
}
View claims.json
{
"UserInfo": {
"id": "#{USER_ID}",
"email": "#{USER_EMAIL}",
"first_name": "#{USER_FIRST_NAME}",
"last_name": "#{USER_LAST_NAME}",
"name": "#{USER_NAME}",
"picture": "#{USER_PROFILE_PICTURE}",
"roles": {
"#{ROLE_NAME}": "#{ROLE_ID}"
View authentication.go
package auth
import (
"context"
"net/http"
"strings"
"google.golang.org/grpc/metadata"
"github.com/andela/micro-api-gateway/pb/authorization"
@codesword
codesword / minikube.md
Last active Oct 31, 2019
Installing minikube using xhyve driver
View minikube.md

###Install docker-machine-driver-xhyve docker-machine-driver-xhyve is a docker machine driver plugin for xhyve native OS X Hypervisor. xhyve is a lightweight OS X virtualization solution. In my opinion, it's a far better option than virtualbox for running minikube. ####Brew On MacOS sierra, download latest using

brew install docker-machine-driver-xhyve --HEAD
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
View sequelize_models_to_migration_generator.js
const Sequelize = require('sequelize');
const models = require('./models');
const fs = require('fs');
// delete models.default;
const sequelize = new Sequelize(
'',
'',
'', {
You can’t perform that action at this time.