Skip to content

Instantly share code, notes, and snippets.

Avatar

Diwaker Gupta diwakergupta

View GitHub Profile
@diwakergupta
diwakergupta / blockstack-cla.md
Last active Jan 3, 2020
Blockstack Contributor License Agreement
View blockstack-cla.md

Blockstack Contributor Agreement

Thank you for your interest in contributing to Blockstack Public Benefit Corporation ("We" or "Us"). The purpose of this contributor agreement ("Agreement") is to clarify and document the rights granted by contributors to Us. To make this document effective, please follow the instructions at https://cla-assistant.io/blockstack/

1. Definitions

  • "You" means the Copyright owner who submits a Contribution to Us. If You are an employee and submit the Contribution as part of your employment, You represent that Your employer has approved this Agreement.
  • "Contribution" means any original work of authorship (software or documentation) including any modifications or additions to an existing work, Submitted by You to Us, in which You own the Copyright. If You do not own the Copyright in the entire work of authorship, please contact Us at legal@blockstack.com.
  • "Copyright" means all rights protecting works of authorship owned or controlled by You, including copyright, moral an
View blockstack
Verifying my Blockstack ID is secured with the address 1JMyoMJEYqr4xhtGj53k4dTJjzQRJYJPp8 https://explorer.blockstack.org/address/1JMyoMJEYqr4xhtGj53k4dTJjzQRJYJPp8
View fix.go
func init() {
// These are not registered in the oauth library by default
oauth2.RegisterBrokenAuthHeaderProvider("https://api.dropboxapi.com")
oauth2.RegisterBrokenAuthHeaderProvider("https://api-dbdev.dev.corp.dropbox.com")
}
View broken.go
var brokenAuthHeaderProviders = []string{
"https://accounts.google.com/",
"https://api.dropbox.com/",
//... elided for brevity
"https://www.googleapis.com/",
"https://www.linkedin.com/",
}
func RegisterBrokenAuthHeaderProvider(tokenURL string) {
brokenAuthHeaderProviders = append(brokenAuthHeaderProviders, tokenURL)
View provider.go
// providerAuthHeaderWorks reports whether the OAuth2 server identified by the tokenURL
// implements the OAuth2 spec correctly
// See https://code.google.com/p/goauth2/issues/detail?id=31 for background.
// In summary:
// - Reddit only accepts client secret in the Authorization header
// - Dropbox accepts either it in URL param or Auth header, but not both.
// - Google only accepts URL param (not spec compliant?), not Auth header
// - Stripe only accepts client secret in Auth header with Bearer method, not Basic
func providerAuthHeaderWorks(tokenURL string) bool {
View register.go
// These are not registered in the oauth library by default
oauth2.RegisterBrokenAuthHeaderProvider("https://api.dropboxapi.com")
View new.go
conf := &oauth2.Config{
ClientID: appKey,
ClientSecret: appSecret,
Endpoint: oauth2.Endpoint{
AuthURL: "https://www.dropbox.com/1/oauth2/authorize",
TokenURL: "https://api.dropboxapi.com/1/oauth2/token",
},
}
View old.go
conf := &oauth2.Config{
ClientID: appKey,
ClientSecret: appSecret,
Endpoint: oauth2.Endpoint{
AuthURL: "https://www.dropbox.com/1/oauth2/authorize",
TokenURL: "https://api.dropbox.com/1/oauth2/token",
},
}
View wp.vhost
<VirtualHost *:80>
ServerName example.com
DocumentRoot /home/diwaker/example.com
<Directory /home/diwaker/example.com>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
</Directory>
View wp.vhost
server {
listen 80;
server_name example.com www.example.com;
root /path/to/example.com;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
You can’t perform that action at this time.