Skip to content

Commit

Permalink
unstaged
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas committed Mar 13, 2018
1 parent 63bfced commit d2e4d2e
Show file tree
Hide file tree
Showing 5 changed files with 3,549 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ The [ORY Security Console](https://console.ory.am/auth/login). connects with you

### ORY Oathkeeper

[ORY Oathkeeper](https://github.com/ory/oathkeeper) is a BeyondCorp/Zero Trust Identity & Access Proxy (IAP) built on top of OAuth2 and ORY Hydra.

## Security

Expand Down
30 changes: 30 additions & 0 deletions pkg/basic_auth.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @author Aeneas Rekkas <aeneas+oss@aeneas.io>
* @Copyright 2017-2018 Aeneas Rekkas <aeneas+oss@aeneas.io>
* @license Apache-2.0
*/

package pkg

import (
"encoding/base64"
"net/url"
)

func BasicAuth(username, password string) string {
return base64.StdEncoding.EncodeToString([]byte(url.QueryEscape(username) + ":" + url.QueryEscape(password)))
}

0 comments on commit d2e4d2e

Please sign in to comment.