-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): project mfa required for v2 routes
Signed-off-by: richardlt <[email protected]>
- Loading branch information
Showing
23 changed files
with
153 additions
and
167 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
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
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
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
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
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
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
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
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,23 +1,20 @@ | ||
package api | ||
|
||
import ( | ||
"context" | ||
"context" | ||
|
||
"github.com/go-gorp/gorp" | ||
|
||
"github.com/ovh/cds/engine/cache" | ||
"github.com/ovh/cds/sdk" | ||
"github.com/ovh/cds/sdk" | ||
) | ||
|
||
func (api *API) pluginRead(ctx context.Context, _ *sdk.AuthUserConsumer, _ cache.Store, _ gorp.SqlExecutor, _ map[string]string) error { | ||
// Old worker | ||
if isWorker(ctx) || getUserConsumer(ctx) != nil { | ||
return nil | ||
} | ||
// New worker | ||
if getWorker(ctx) != nil { | ||
return nil | ||
} | ||
func (api *API) pluginRead(ctx context.Context, _ map[string]string) error { | ||
// Old worker | ||
if isWorker(ctx) || getUserConsumer(ctx) != nil { | ||
return nil | ||
} | ||
// New worker | ||
if getWorker(ctx) != nil { | ||
return nil | ||
} | ||
|
||
return sdk.WithStack(sdk.ErrForbidden) | ||
return sdk.WithStack(sdk.ErrForbidden) | ||
} |
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
Oops, something went wrong.