forked from ory/hydra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugin: disable plugins through tags
Debugging Hydra in Go 1.10 and 1.11 (confirmed by one of its members), is not possible due to [this unresolved bug](golang/go#23733) which is related to the use of the plugin functionality. This change allows passing a build tag which will disable plugin implementation and therefore allow to debug in all the use-cases where plugin backend is not needed. Signed-off-by: Gorka Lerchundi Osa <[email protected]>
- Loading branch information
1 parent
4a1489b
commit 8768d32
Showing
2 changed files
with
58 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
/* | ||
* Copyright © 2015-2018 Aeneas Rekkas <[email protected]> | ||
* | ||
* 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 <[email protected]> | ||
* @copyright 2015-2018 Aeneas Rekkas <[email protected]> | ||
* @license Apache-2.0 | ||
*/ | ||
// | ||
// Copyright © 2015-2018 Aeneas Rekkas <[email protected]> | ||
// | ||
// 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 <[email protected]> | ||
// @copyright 2015-2018 Aeneas Rekkas <[email protected]> | ||
// @license Apache-2.0 | ||
// | ||
|
||
// +build !noplugin | ||
|
||
package config | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// Copyright © 2015-2018 Gorka Lerchundi Osa <[email protected]> | ||
// | ||
// 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 Gorka Lerchundi Osa <[email protected]> | ||
// @copyright 2015-2018 Gorka Lerchundi Osa <[email protected]> | ||
// @license Apache-2.0 | ||
// | ||
|
||
// +build noplugin | ||
|
||
package config | ||
|
||
import ( | ||
"github.com/pkg/errors" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
type PluginConnection struct { | ||
Config *Config | ||
Logger logrus.FieldLogger | ||
} | ||
|
||
func (c *PluginConnection) Load() error { | ||
return errors.New("config: unable to load plugin connection because 'noplugin' tag was declared") | ||
} |