-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kick off CRUD API & Minder API Authz (#4970)
* add: kick off CRUD API & Minder API Authz * fix: unused req param * Register data source service in control plane server Signed-off-by: Juan Antonio Osorio <[email protected]> * Use ContextV2 in data sources Signed-off-by: Juan Antonio Osorio <[email protected]> --------- Signed-off-by: Juan Antonio Osorio <[email protected]> Co-authored-by: Juan Antonio Osorio <[email protected]>
- Loading branch information
1 parent
f117ed1
commit 9b7eaac
Showing
12 changed files
with
8,662 additions
and
6,805 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,69 @@ | ||
// SPDX-FileCopyrightText: Copyright 2024 The Minder Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package controlplane | ||
|
||
import ( | ||
"context" | ||
|
||
"google.golang.org/grpc/codes" | ||
"google.golang.org/grpc/status" | ||
|
||
"github.com/mindersec/minder/internal/flags" | ||
minderv1 "github.com/mindersec/minder/pkg/api/protobuf/go/minder/v1" | ||
) | ||
|
||
// CreateDataSource creates a data source | ||
func (s *Server) CreateDataSource(ctx context.Context, | ||
_ *minderv1.CreateDataSourceRequest) (*minderv1.CreateDataSourceResponse, error) { | ||
|
||
if !flags.Bool(ctx, s.featureFlags, flags.DataSources) { | ||
return nil, status.Errorf(codes.Unavailable, "DataSources feature is disabled") | ||
} | ||
|
||
return &minderv1.CreateDataSourceResponse{}, nil | ||
} | ||
|
||
// GetDataSourceById retrieves a data source by ID | ||
func (s *Server) GetDataSourceById(ctx context.Context, | ||
_ *minderv1.GetDataSourceByIdRequest) (*minderv1.GetDataSourceByIdResponse, error) { | ||
|
||
if !flags.Bool(ctx, s.featureFlags, flags.DataSources) { | ||
return nil, status.Errorf(codes.Unavailable, "DataSources feature is disabled") | ||
} | ||
|
||
return &minderv1.GetDataSourceByIdResponse{}, nil | ||
} | ||
|
||
// ListDataSources lists all data sources | ||
func (s *Server) ListDataSources(ctx context.Context, | ||
_ *minderv1.ListDataSourcesRequest) (*minderv1.ListDataSourcesResponse, error) { | ||
|
||
if !flags.Bool(ctx, s.featureFlags, flags.DataSources) { | ||
return nil, status.Errorf(codes.Unavailable, "DataSources feature is disabled") | ||
} | ||
|
||
return &minderv1.ListDataSourcesResponse{}, nil | ||
} | ||
|
||
// UpdateDataSource updates a data source | ||
func (s *Server) UpdateDataSource(ctx context.Context, | ||
_ *minderv1.UpdateDataSourceRequest) (*minderv1.UpdateDataSourceResponse, error) { | ||
|
||
if !flags.Bool(ctx, s.featureFlags, flags.DataSources) { | ||
return nil, status.Errorf(codes.Unavailable, "DataSources feature is disabled") | ||
} | ||
|
||
return &minderv1.UpdateDataSourceResponse{}, nil | ||
} | ||
|
||
// DeleteDataSource deletes a data source | ||
func (s *Server) DeleteDataSource(ctx context.Context, | ||
_ *minderv1.DeleteDataSourceRequest) (*minderv1.DeleteDataSourceResponse, error) { | ||
|
||
if !flags.Bool(ctx, s.featureFlags, flags.DataSources) { | ||
return nil, status.Errorf(codes.Unavailable, "DataSources feature is disabled") | ||
} | ||
|
||
return &minderv1.DeleteDataSourceResponse{}, nil | ||
} |
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
Oops, something went wrong.