From 9991ac5c1ed97661e8d613637a7517eb57303882 Mon Sep 17 00:00:00 2001 From: kristinaspring Date: Tue, 6 Oct 2020 15:26:27 -0700 Subject: [PATCH] Misc (#66) * prepared changelog for release * added one unit test case for attributes * added copyright comment everywhere * fixed changelog --- CHANGELOG.md | 6 +++++- NOTICE | 4 ++-- README.md | 2 +- acquire/auth.go | 17 +++++++++++++++++ acquire/auth_test.go | 17 +++++++++++++++++ acquire/bearer.go | 17 +++++++++++++++++ acquire/bearer_test.go | 17 +++++++++++++++++ attributes.go | 17 +++++++++++++++++ attributes_test.go | 21 +++++++++++++++++++++ basculehttp/constructor.go | 17 +++++++++++++++++ basculehttp/constructor_test.go | 17 +++++++++++++++++ basculehttp/enforcer.go | 17 +++++++++++++++++ basculehttp/enforcer_test.go | 17 +++++++++++++++++ basculehttp/errorResponseReason.go | 17 +++++++++++++++++ basculehttp/http.go | 17 +++++++++++++++++ basculehttp/http_test.go | 17 +++++++++++++++++ basculehttp/listener.go | 17 +++++++++++++++++ basculehttp/listener_test.go | 17 +++++++++++++++++ basculehttp/mocks_test.go | 17 +++++++++++++++++ basculehttp/tokenFactory.go | 17 +++++++++++++++++ basculehttp/tokenFactory_test.go | 17 +++++++++++++++++ checks.go | 17 +++++++++++++++++ checks_test.go | 17 +++++++++++++++++ context.go | 17 +++++++++++++++++ context_test.go | 17 +++++++++++++++++ error.go | 17 +++++++++++++++++ error_test.go | 17 +++++++++++++++++ jws.go | 17 +++++++++++++++++ jws_test.go | 17 +++++++++++++++++ key/cache.go | 17 +++++++++++++++++ key/cache_test.go | 17 +++++++++++++++++ key/doc.go | 17 +++++++++++++++++ key/mocks.go | 17 +++++++++++++++++ key/pair.go | 17 +++++++++++++++++ key/parser.go | 17 +++++++++++++++++ key/parser_test.go | 17 +++++++++++++++++ key/purpose.go | 17 +++++++++++++++++ key/purpose_test.go | 20 +++++++++++++++++++- key/resolver.go | 17 +++++++++++++++++ key/resolverFactory.go | 17 +++++++++++++++++ key/resolverFactory_test.go | 17 +++++++++++++++++ key/resolver_test.go | 17 +++++++++++++++++ key/setup_test.go | 17 +++++++++++++++++ key/update.go | 17 +++++++++++++++++ log.go | 17 +++++++++++++++++ token.go | 17 +++++++++++++++++ token_test.go | 17 +++++++++++++++++ validator.go | 17 +++++++++++++++++ validator_test.go | 17 +++++++++++++++++ 49 files changed, 796 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 417cecb..f591d90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [v0.9.0] - added helper function for building basic auth map [#59](https://github.com/xmidt-org/bascule/pull/59) - fixed references to the main branch [#61](https://github.com/xmidt-org/bascule/pull/61) +- fixed attributes to be case sensitive and simplified the Attributes interface [#64](https://github.com/xmidt-org/bascule/pull/64) ## [v0.8.1] - fixed data race in RemoteBearerTokenAcquirer [#55](https://github.com/xmidt-org/bascule/pull/55) @@ -76,7 +79,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added constructor, enforcer, and listener alice decorators - Basic code and structure established -[Unreleased]: https://github.com/xmidt-org/bascule/compare/v0.8.1...HEAD +[Unreleased]: https://github.com/xmidt-org/bascule/compare/v0.9.0...HEAD +[v0.9.0]: https://github.com/xmidt-org/bascule/compare/v0.8.1...v0.9.0 [v0.8.1]: https://github.com/xmidt-org/bascule/compare/v0.8.0...v0.8.1 [v0.8.0]: https://github.com/xmidt-org/bascule/compare/v0.7.0...v0.8.0 [v0.7.0]: https://github.com/xmidt-org/bascule/compare/v0.6.0...v0.7.0 diff --git a/NOTICE b/NOTICE index a451e1f..0de0e0f 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ -comcast-bascule -Copyright 2019 Comcast Cable Communications Management, LLC +bascule +Copyright 2020 Comcast Cable Communications Management, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 1c07f4b..40e484c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# comcast-bascule +# bascule The library for authorization: both acquiring and validating. diff --git a/acquire/auth.go b/acquire/auth.go index 34e0749..b84aac7 100644 --- a/acquire/auth.go +++ b/acquire/auth.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + // Package acquire is used for getting Auths to pass in http requests. package acquire diff --git a/acquire/auth_test.go b/acquire/auth_test.go index fe020c3..a483041 100644 --- a/acquire/auth_test.go +++ b/acquire/auth_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package acquire import ( diff --git a/acquire/bearer.go b/acquire/bearer.go index b0cae2b..23b057f 100644 --- a/acquire/bearer.go +++ b/acquire/bearer.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package acquire import ( diff --git a/acquire/bearer_test.go b/acquire/bearer_test.go index 7025267..a92c5b6 100644 --- a/acquire/bearer_test.go +++ b/acquire/bearer_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package acquire import ( diff --git a/attributes.go b/attributes.go index 9e436cf..87f3720 100644 --- a/attributes.go +++ b/attributes.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package bascule import ( diff --git a/attributes_test.go b/attributes_test.go index 56adfa6..b666345 100644 --- a/attributes_test.go +++ b/attributes_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package bascule import ( @@ -75,6 +92,10 @@ func TestGetNestedAttribute(t *testing.T) { description: "Missing Key Error", keys: []string{"c", "b", "a"}, }, + { + description: "Wrong Key Case Error", + keys: []string{"A", "B", "C"}, + }, } for _, tc := range tests { t.Run(tc.description, func(t *testing.T) { diff --git a/basculehttp/constructor.go b/basculehttp/constructor.go index 541f246..94fb982 100644 --- a/basculehttp/constructor.go +++ b/basculehttp/constructor.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package basculehttp import ( diff --git a/basculehttp/constructor_test.go b/basculehttp/constructor_test.go index aad3a4f..e7f6e81 100644 --- a/basculehttp/constructor_test.go +++ b/basculehttp/constructor_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package basculehttp import ( diff --git a/basculehttp/enforcer.go b/basculehttp/enforcer.go index f2413cf..68371c0 100644 --- a/basculehttp/enforcer.go +++ b/basculehttp/enforcer.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package basculehttp import ( diff --git a/basculehttp/enforcer_test.go b/basculehttp/enforcer_test.go index 93cf2af..d333251 100644 --- a/basculehttp/enforcer_test.go +++ b/basculehttp/enforcer_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package basculehttp import ( diff --git a/basculehttp/errorResponseReason.go b/basculehttp/errorResponseReason.go index 8ed1c9f..fd411fd 100644 --- a/basculehttp/errorResponseReason.go +++ b/basculehttp/errorResponseReason.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package basculehttp //go:generate stringer -type=ErrorResponseReason diff --git a/basculehttp/http.go b/basculehttp/http.go index 4a35d22..fb91b0e 100644 --- a/basculehttp/http.go +++ b/basculehttp/http.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + // package basculehttp contains some basic http middleware (in the form of // Alice-style decorators) that can be used to extract and parse a Token from // an http header, validate the Token, and allow for the consumer to add diff --git a/basculehttp/http_test.go b/basculehttp/http_test.go index 3b79fbc..e722593 100644 --- a/basculehttp/http_test.go +++ b/basculehttp/http_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package basculehttp import ( diff --git a/basculehttp/listener.go b/basculehttp/listener.go index 2fdc87c..237fb77 100644 --- a/basculehttp/listener.go +++ b/basculehttp/listener.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package basculehttp import ( diff --git a/basculehttp/listener_test.go b/basculehttp/listener_test.go index 438ce1e..a40c3e8 100644 --- a/basculehttp/listener_test.go +++ b/basculehttp/listener_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package basculehttp import ( diff --git a/basculehttp/mocks_test.go b/basculehttp/mocks_test.go index 0527168..2eaae21 100644 --- a/basculehttp/mocks_test.go +++ b/basculehttp/mocks_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package basculehttp import ( diff --git a/basculehttp/tokenFactory.go b/basculehttp/tokenFactory.go index 891e510..ed2ea5c 100644 --- a/basculehttp/tokenFactory.go +++ b/basculehttp/tokenFactory.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package basculehttp import ( diff --git a/basculehttp/tokenFactory_test.go b/basculehttp/tokenFactory_test.go index f0b03f9..5fe3c03 100644 --- a/basculehttp/tokenFactory_test.go +++ b/basculehttp/tokenFactory_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package basculehttp import ( diff --git a/checks.go b/checks.go index a2b0642..980cf3b 100644 --- a/checks.go +++ b/checks.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + // some factories to make common validation checks package bascule diff --git a/checks_test.go b/checks_test.go index 273ab7f..a0e3f1e 100644 --- a/checks_test.go +++ b/checks_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package bascule import ( diff --git a/context.go b/context.go index 8209ce0..920a1ba 100644 --- a/context.go +++ b/context.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package bascule import ( diff --git a/context_test.go b/context_test.go index 611b4c6..8b87caf 100644 --- a/context_test.go +++ b/context_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package bascule import ( diff --git a/error.go b/error.go index 9b2ac51..affbd40 100644 --- a/error.go +++ b/error.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package bascule import ( diff --git a/error_test.go b/error_test.go index 2763751..49af273 100644 --- a/error_test.go +++ b/error_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package bascule import ( diff --git a/jws.go b/jws.go index 6fae206..8406e5a 100644 --- a/jws.go +++ b/jws.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package bascule import ( diff --git a/jws_test.go b/jws_test.go index 7fa2d69..a305277 100644 --- a/jws_test.go +++ b/jws_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package bascule import ( diff --git a/key/cache.go b/key/cache.go index 65f4d26..bec1dae 100644 --- a/key/cache.go +++ b/key/cache.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/key/cache_test.go b/key/cache_test.go index bedd5fa..b1c80e2 100644 --- a/key/cache_test.go +++ b/key/cache_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/key/doc.go b/key/doc.go index 655a490..f2b7704 100644 --- a/key/doc.go +++ b/key/doc.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + /* Package key provides a simple API for loading public and private keys from resources. */ diff --git a/key/mocks.go b/key/mocks.go index 1f47748..0010444 100644 --- a/key/mocks.go +++ b/key/mocks.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/key/pair.go b/key/pair.go index 560fbba..e2ba254 100644 --- a/key/pair.go +++ b/key/pair.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/key/parser.go b/key/parser.go index 6e4631a..4bc852b 100644 --- a/key/parser.go +++ b/key/parser.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/key/parser_test.go b/key/parser_test.go index ecef4ed..a278785 100644 --- a/key/parser_test.go +++ b/key/parser_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/key/purpose.go b/key/purpose.go index 4561339..bc2d60f 100644 --- a/key/purpose.go +++ b/key/purpose.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/key/purpose_test.go b/key/purpose_test.go index f916b1f..4d9c7db 100644 --- a/key/purpose_test.go +++ b/key/purpose_test.go @@ -1,9 +1,27 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( "encoding/json" - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestPurposeString(t *testing.T) { diff --git a/key/resolver.go b/key/resolver.go index bf6e567..bfe7936 100644 --- a/key/resolver.go +++ b/key/resolver.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/key/resolverFactory.go b/key/resolverFactory.go index 4ed0e11..c35ace8 100644 --- a/key/resolverFactory.go +++ b/key/resolverFactory.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/key/resolverFactory_test.go b/key/resolverFactory_test.go index 230d4de..1f9d7ea 100644 --- a/key/resolverFactory_test.go +++ b/key/resolverFactory_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/key/resolver_test.go b/key/resolver_test.go index b1d1474..dba458d 100644 --- a/key/resolver_test.go +++ b/key/resolver_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/key/setup_test.go b/key/setup_test.go index 43bef9b..5910f2f 100644 --- a/key/setup_test.go +++ b/key/setup_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/key/update.go b/key/update.go index 7c5edde..0593c7a 100644 --- a/key/update.go +++ b/key/update.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package key import ( diff --git a/log.go b/log.go index fd618b3..f084d3b 100644 --- a/log.go +++ b/log.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package bascule import ( diff --git a/token.go b/token.go index 2e66154..c697168 100644 --- a/token.go +++ b/token.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + // package bascule provides a token interface and basic implementation, which // can be validated and added and taken from a context. Some basic checks // which can be used to validate are also provided. diff --git a/token_test.go b/token_test.go index ef96077..382611c 100644 --- a/token_test.go +++ b/token_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package bascule import ( diff --git a/validator.go b/validator.go index 4798c82..1ddfa25 100644 --- a/validator.go +++ b/validator.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + // Validator provides tools for validating authorization tokens. Validation is // done through running the rules provided. If a token is considered not valid, // the validator will return an error. diff --git a/validator_test.go b/validator_test.go index eb283f9..7c28d56 100644 --- a/validator_test.go +++ b/validator_test.go @@ -1,3 +1,20 @@ +/** + * Copyright 2020 Comcast Cable Communications Management, LLC + * + * 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. + * + */ + package bascule import (