feat: create api keys service
@@ -0,0 +1,21 @@
+CREATE TABLE IF NOT EXISTS argus.users ( + id uuid, + email text, + password_hash text, + created_at timestamp, + updated_at timestamp, + PRIMARY KEY (id, created_at) +) WITH CLUSTERING ORDER BY (created_at DESC); + +CREATE TABLE IF NOT EXISTS argus.api_keys ( + id uuid, + user_id uuid, + name text, + key_hash text, + created_at timestamp, + last_used_at timestamp, + expires_at timestamp, + is_active boolean, + PRIMARY KEY (id, created_at) +) WITH CLUSTERING ORDER BY (created_at DESC); +
@@ -0,0 +1,10 @@
+package apikeys + +import "errors" + +var ( + ErrAPIKeyInvalid = errors.New("invalid API key") + ErrAPIKeyExpired = errors.New("API key expired") + ErrAPIKeyRevoked = errors.New("API key revoked") + ErrUnauthorized = errors.New("unauthorized") +)
@@ -2,7 +2,6 @@ package apikeys
import ( "context" - "strings" "time" "argus-core/internal/auth"@@ -13,7 +12,7 @@ "github.com/gocql/gocql"
"github.com/twitchtv/twirp" ) -// TwirpServer implements the generated Twirp APIKeysService interface +// TwirpServer implements the APIKeysService for managing API keys type TwirpServer struct { authService auth.Service db database.Service@@ -24,64 +23,87 @@ func NewTwirpServer(authService auth.Service, db database.Service) pb.APIKeysService {
return &TwirpServer{authService: authService, db: db} } +// formatAPIKeyResponse converts a database API key to a protobuf API key +func formatAPIKeyResponse(apiKey *database.APIKey) *pb.APIKey { + response := &pb.APIKey{ + Id: apiKey.ID.String(), + UserId: apiKey.UserID.String(), + Name: apiKey.Name, + CreatedAt: apiKey.CreatedAt.Format(time.RFC3339), + IsActive: apiKey.IsActive, + } + + if apiKey.LastUsedAt != nil { + response.LastUsedAt = apiKey.LastUsedAt.Format(time.RFC3339) + } + + if apiKey.ExpiresAt != nil { + response.ExpiresAt = apiKey.ExpiresAt.Format(time.RFC3339) + } + + return response +} + // CreateAPIKey implements the Twirp APIKeysService CreateAPIKey method func (s *TwirpServer) CreateAPIKey(ctx context.Context, req *pb.CreateAPIKeyRequest) (*pb.CreateAPIKeyResponse, error) { - userID, err := s.authorize(ctx) + if req.Token == "" { + return nil, twirp.NewError(twirp.Unauthenticated, "token is required") + } + if req.Name == "" { + return nil, twirp.NewError(twirp.InvalidArgument, "name is required") + } + + // Validate token and get user + user, err := s.authService.ValidateToken(req.Token) if err != nil { - return nil, err + return nil, twirp.NewError(twirp.Unauthenticated, "invalid token") } + // Parse expiration date if provided var expiresAt *time.Time if req.ExpiresAt != "" { t, err := time.Parse(time.RFC3339, req.ExpiresAt) if err != nil { - return nil, twirp.NewError(twirp.InvalidArgument, "invalid expiration date format") + return nil, twirp.NewError(twirp.InvalidArgument, "expires_at must be in RFC3339 format") + } + if t.Before(time.Now()) { + return nil, twirp.NewError(twirp.InvalidArgument, "expiration date cannot be in the past") } expiresAt = &t } - apiKey, keyString, err := s.authService.CreateAPIKey(userID, req.Name, expiresAt) + // Create API key + apiKey, keyString, err := s.authService.CreateAPIKey(user.ID, req.Name, expiresAt) if err != nil { return nil, twirp.InternalErrorWith(err) } return &pb.CreateAPIKeyResponse{ - ApiKey: &pb.APIKey{ - Id: apiKey.ID.String(), - UserId: apiKey.UserID.String(), - Name: apiKey.Name, - CreatedAt: apiKey.CreatedAt.Format(time.RFC3339), - LastUsedAt: apiKey.LastUsedAt.Format(time.RFC3339), - ExpiresAt: apiKey.ExpiresAt.Format(time.RFC3339), - IsActive: apiKey.IsActive, - }, - Key: keyString, + ApiKey: formatAPIKeyResponse(apiKey), + Key: keyString, }, nil } // ListAPIKeys implements the Twirp APIKeysService ListAPIKeys method func (s *TwirpServer) ListAPIKeys(ctx context.Context, req *pb.ListAPIKeysRequest) (*pb.ListAPIKeysResponse, error) { - userID, err := s.authorize(ctx) + if req.Token == "" { + return nil, twirp.NewError(twirp.Unauthenticated, "token is required") + } + + // Validate token and get user + user, err := s.authService.ValidateToken(req.Token) if err != nil { - return nil, err + return nil, twirp.NewError(twirp.Unauthenticated, "invalid token") } - apiKeys, err := s.authService.ListAPIKeys(userID) + apiKeys, err := s.authService.ListAPIKeys(user.ID) if err != nil { return nil, twirp.InternalErrorWith(err) } var pbAPIKeys []*pb.APIKey for _, apiKey := range apiKeys { - pbAPIKeys = append(pbAPIKeys, &pb.APIKey{ - Id: apiKey.ID.String(), - UserId: apiKey.UserID.String(), - Name: apiKey.Name, - CreatedAt: apiKey.CreatedAt.Format(time.RFC3339), - LastUsedAt: apiKey.LastUsedAt.Format(time.RFC3339), - ExpiresAt: apiKey.ExpiresAt.Format(time.RFC3339), - IsActive: apiKey.IsActive, - }) + pbAPIKeys = append(pbAPIKeys, formatAPIKeyResponse(&apiKey)) } return &pb.ListAPIKeysResponse{ApiKeys: pbAPIKeys}, nil@@ -89,18 +111,29 @@ }
// RevokeAPIKey implements the Twirp APIKeysService RevokeAPIKey method func (s *TwirpServer) RevokeAPIKey(ctx context.Context, req *pb.RevokeAPIKeyRequest) (*pb.RevokeAPIKeyResponse, error) { - userID, err := s.authorize(ctx) + if req.Token == "" { + return nil, twirp.NewError(twirp.Unauthenticated, "token is required") + } + if req.KeyId == "" { + return nil, twirp.NewError(twirp.InvalidArgument, "key_id is required") + } + + // Validate token and get user + user, err := s.authService.ValidateToken(req.Token) if err != nil { - return nil, err + return nil, twirp.NewError(twirp.Unauthenticated, "invalid token") } keyID, err := gocql.ParseUUID(req.KeyId) if err != nil { - return nil, twirp.NewError(twirp.InvalidArgument, "invalid key ID") + return nil, twirp.NewError(twirp.InvalidArgument, "invalid key ID format") } - err = s.authService.RevokeAPIKey(userID, keyID) + err = s.authService.RevokeAPIKey(user.ID, keyID) if err != nil { + if err == ErrAPIKeyInvalid { + return nil, twirp.NewError(twirp.NotFound, "API key not found") + } return nil, twirp.InternalErrorWith(err) }@@ -109,45 +142,31 @@ }
// DeleteAPIKey implements the Twirp APIKeysService DeleteAPIKey method func (s *TwirpServer) DeleteAPIKey(ctx context.Context, req *pb.DeleteAPIKeyRequest) (*pb.DeleteAPIKeyResponse, error) { - userID, err := s.authorize(ctx) + if req.Token == "" { + return nil, twirp.NewError(twirp.Unauthenticated, "token is required") + } + if req.KeyId == "" { + return nil, twirp.NewError(twirp.InvalidArgument, "key_id is required") + } + + // Validate token and get user + user, err := s.authService.ValidateToken(req.Token) if err != nil { - return nil, err + return nil, twirp.NewError(twirp.Unauthenticated, "invalid token") } keyID, err := gocql.ParseUUID(req.KeyId) if err != nil { - return nil, twirp.NewError(twirp.InvalidArgument, "invalid key ID") + return nil, twirp.NewError(twirp.InvalidArgument, "invalid key ID format") } - err = s.authService.DeleteAPIKey(userID, keyID) + err = s.authService.DeleteAPIKey(user.ID, keyID) if err != nil { + if err == ErrAPIKeyInvalid { + return nil, twirp.NewError(twirp.NotFound, "API key not found") + } return nil, twirp.InternalErrorWith(err) } return &pb.DeleteAPIKeyResponse{}, nil } - -// authorize checks the authorization token and returns the user ID -func (s *TwirpServer) authorize(ctx context.Context) (gocql.UUID, error) { - headers, ok := twirp.HTTPRequestHeaders(ctx) - if !ok { - return gocql.UUID{}, twirp.NewError(twirp.Unauthenticated, "missing authorization token") - } - - authHeader := headers.Get("Authorization") - if authHeader == "" { - return gocql.UUID{}, twirp.NewError(twirp.Unauthenticated, "missing authorization token") - } - - token := strings.TrimPrefix(authHeader, "Bearer ") - if token == authHeader { - return gocql.UUID{}, twirp.NewError(twirp.Unauthenticated, "invalid authorization token format") - } - - user, err := s.authService.ValidateToken(token) - if err != nil { - return gocql.UUID{}, twirp.NewError(twirp.Unauthenticated, "invalid token") - } - - return user.ID, nil -}
@@ -0,0 +1,16 @@
+package apikeys + +import ( + pb "argus-core/rpc/apikeys" + "fmt" +) + +func validateCreateAPIKeyRequest(req *pb.CreateAPIKeyRequest) error { + if req.Name == "" { + return fmt.Errorf("name is required") + } + if len(req.Name) > 255 { + return fmt.Errorf("name must be less than 256 characters") + } + return nil +}
@@ -244,17 +244,17 @@ }
func (s *service) DeleteAPIKey(userID, keyID gocql.UUID) error { // First verify the API key belongs to the user - var count int + var apiKey APIKey if err := s.session.Query(` - SELECT COUNT(*) FROM api_keys - WHERE id = ? AND user_id = ? ALLOW FILTERING`, - keyID, userID, - ).Scan(&count); err != nil { - return fmt.Errorf("error verifying API key ownership: %w", err) + SELECT id, user_id FROM api_keys + WHERE id = ? ALLOW FILTERING`, + keyID, + ).Scan(&apiKey.ID, &apiKey.UserID); err != nil { + return fmt.Errorf("API key not found: %w", err) } - if count == 0 { - return fmt.Errorf("API key not found or not owned by user") + if apiKey.UserID != userID { + return fmt.Errorf("API key not owned by user") } // Delete the API key
@@ -57,10 +57,13 @@ // Create Twirp Server handlers
authHandler := authpb.NewAuthServiceServer(auth.NewTwirpServer(authService)) apiKeysHandler := apikeyspb.NewAPIKeysServiceServer(apikeys.NewTwirpServer(authService, db)) + fmt.Println("auth prefix: " + authHandler.PathPrefix()) + fmt.Println("apiKeys prefix: " + apiKeysHandler.PathPrefix()) + // Combine handlers mux := http.NewServeMux() - mux.Handle(authpb.AuthServicePathPrefix, authHandler) - mux.Handle(apikeyspb.APIKeysServicePathPrefix, apiKeysHandler) + mux.Handle(authHandler.PathPrefix(), authHandler) + mux.Handle(apiKeysHandler.PathPrefix(), apiKeysHandler) // Wrap the mux with CORS middleware handler := CORSMiddleware(mux)
@@ -20,14 +20,14 @@ // Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Request and Response messages type CreateAPIKeyRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - ExpiresAt string `protobuf:"bytes,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` // optional expiration date in RFC3339 format + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + ExpiresAt string `protobuf:"bytes,3,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` } func (x *CreateAPIKeyRequest) Reset() {@@ -60,6 +60,13 @@ func (*CreateAPIKeyRequest) Descriptor() ([]byte, []int) {
return file_rpc_apikeys_service_proto_rawDescGZIP(), []int{0} } +func (x *CreateAPIKeyRequest) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + func (x *CreateAPIKeyRequest) GetName() string { if x != nil { return x.Name@@ -80,7 +87,7 @@ sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields ApiKey *APIKey `protobuf:"bytes,1,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` // the actual API key string + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` } func (x *CreateAPIKeyResponse) Reset() {@@ -131,6 +138,8 @@ type ListAPIKeysRequest struct {
state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` } func (x *ListAPIKeysRequest) Reset() {@@ -163,6 +172,13 @@ func (*ListAPIKeysRequest) Descriptor() ([]byte, []int) {
return file_rpc_apikeys_service_proto_rawDescGZIP(), []int{2} } +func (x *ListAPIKeysRequest) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + type ListAPIKeysResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache@@ -213,7 +229,8 @@ state protoimpl.MessageState
sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - KeyId string `protobuf:"bytes,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + KeyId string `protobuf:"bytes,2,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` } func (x *RevokeAPIKeyRequest) Reset() {@@ -246,6 +263,13 @@ func (*RevokeAPIKeyRequest) Descriptor() ([]byte, []int) {
return file_rpc_apikeys_service_proto_rawDescGZIP(), []int{4} } +func (x *RevokeAPIKeyRequest) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + func (x *RevokeAPIKeyRequest) GetKeyId() string { if x != nil { return x.KeyId@@ -294,7 +318,8 @@ state protoimpl.MessageState
sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - KeyId string `protobuf:"bytes,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + KeyId string `protobuf:"bytes,2,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` } func (x *DeleteAPIKeyRequest) Reset() {@@ -327,6 +352,13 @@ func (*DeleteAPIKeyRequest) Descriptor() ([]byte, []int) {
return file_rpc_apikeys_service_proto_rawDescGZIP(), []int{6} } +func (x *DeleteAPIKeyRequest) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + func (x *DeleteAPIKeyRequest) GetKeyId() string { if x != nil { return x.KeyId@@ -370,7 +402,6 @@ func (*DeleteAPIKeyResponse) Descriptor() ([]byte, []int) {
return file_rpc_apikeys_service_proto_rawDescGZIP(), []int{7} } -// Common messages type APIKey struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache@@ -469,66 +500,71 @@
var file_rpc_apikeys_service_proto_rawDesc = []byte{ 0x0a, 0x19, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x61, 0x70, 0x69, - 0x6b, 0x65, 0x79, 0x73, 0x22, 0x48, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, - 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x22, 0x52, - 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x07, 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, - 0x73, 0x2e, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x22, 0x14, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x41, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, - 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x2a, 0x0a, 0x08, 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x41, 0x50, 0x49, 0x4b, - 0x65, 0x79, 0x52, 0x07, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x2c, 0x0a, 0x13, 0x52, - 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x52, 0x65, 0x76, - 0x6f, 0x6b, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2c, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x22, - 0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc2, 0x01, 0x0a, 0x06, 0x41, 0x50, 0x49, 0x4b, - 0x65, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x20, - 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x73, 0x65, 0x64, 0x41, 0x74, - 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, - 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x32, 0xc1, 0x02, 0x0a, - 0x0e, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x4b, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x12, - 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, - 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, - 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0b, - 0x4c, 0x69, 0x73, 0x74, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1b, 0x2e, 0x61, 0x70, - 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, - 0x79, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, - 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, - 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x52, + 0x6b, 0x65, 0x79, 0x73, 0x22, 0x5e, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, + 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, + 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x73, 0x41, 0x74, 0x22, 0x52, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, + 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x07, + 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, + 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x06, + 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x2a, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x41, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x50, 0x49, 0x4b, + 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x08, 0x61, + 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, + 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x07, + 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x42, 0x0a, 0x13, 0x52, 0x65, 0x76, 0x6f, 0x6b, + 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, - 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x42, 0x18, 0x5a, 0x16, 0x61, 0x72, 0x67, 0x75, 0x73, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, - 0x70, 0x63, 0x2f, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x6e, 0x73, 0x65, 0x22, 0x42, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, + 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x15, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0xc2, 0x01, 0x0a, 0x06, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, + 0x73, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x61, + 0x73, 0x74, 0x55, 0x73, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x32, 0xc1, 0x02, 0x0a, 0x0e, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x73, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, + 0x73, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x50, 0x49, 0x4b, + 0x65, 0x79, 0x73, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, + 0x50, 0x49, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, + 0x0a, 0x0c, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x12, 0x1c, + 0x2e, 0x61, 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, + 0x50, 0x49, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, + 0x70, 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x41, 0x50, 0x49, + 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x2e, 0x61, 0x70, + 0x69, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4b, + 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x6b, + 0x65, 0x79, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x18, 0x5a, 0x16, 0x61, 0x72, 0x67, 0x75, + 0x73, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x70, 0x69, 0x6b, 0x65, + 0x79, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (
@@ -3,51 +3,45 @@
package apikeys; option go_package = "argus-core/rpc/apikeys"; -// APIKeys service handles API key creation, listing, revocation, and deletion. service APIKeysService { - // CreateAPIKey creates a new API key for the authenticated user. rpc CreateAPIKey(CreateAPIKeyRequest) returns (CreateAPIKeyResponse); - - // ListAPIKeys lists all API keys for the authenticated user. rpc ListAPIKeys(ListAPIKeysRequest) returns (ListAPIKeysResponse); - - // RevokeAPIKey revokes an API key for the authenticated user. rpc RevokeAPIKey(RevokeAPIKeyRequest) returns (RevokeAPIKeyResponse); - - // DeleteAPIKey deletes an API key for the authenticated user. rpc DeleteAPIKey(DeleteAPIKeyRequest) returns (DeleteAPIKeyResponse); } - -// Request and Response messages message CreateAPIKeyRequest { - string name = 1; - string expires_at = 2; // optional expiration date in RFC3339 format + string token = 1; + string name = 2; + string expires_at = 3; } message CreateAPIKeyResponse { APIKey api_key = 1; - string key = 2; // the actual API key string + string key = 2; } -message ListAPIKeysRequest {} +message ListAPIKeysRequest { + string token = 1; +} message ListAPIKeysResponse { repeated APIKey api_keys = 1; } message RevokeAPIKeyRequest { - string key_id = 1; + string token = 1; + string key_id = 2; } message RevokeAPIKeyResponse {} message DeleteAPIKeyRequest { - string key_id = 1; + string token = 1; + string key_id = 2; } message DeleteAPIKeyResponse {} -// Common messages message APIKey { string id = 1; string user_id = 2;
@@ -31,18 +31,13 @@ // ========================
// APIKeysService Interface // ======================== -// APIKeys service handles API key creation, listing, revocation, and deletion. type APIKeysService interface { - // CreateAPIKey creates a new API key for the authenticated user. CreateAPIKey(context.Context, *CreateAPIKeyRequest) (*CreateAPIKeyResponse, error) - // ListAPIKeys lists all API keys for the authenticated user. ListAPIKeys(context.Context, *ListAPIKeysRequest) (*ListAPIKeysResponse, error) - // RevokeAPIKey revokes an API key for the authenticated user. RevokeAPIKey(context.Context, *RevokeAPIKeyRequest) (*RevokeAPIKeyResponse, error) - // DeleteAPIKey deletes an API key for the authenticated user. DeleteAPIKey(context.Context, *DeleteAPIKeyRequest) (*DeleteAPIKeyResponse, error) }@@ -1929,32 +1924,33 @@ h.Error(ctx, err)
} var twirpFileDescriptor0 = []byte{ - // 431 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xcd, 0x8e, 0xd3, 0x30, - 0x14, 0x85, 0x95, 0x76, 0x26, 0x6d, 0xef, 0x54, 0x03, 0x72, 0xcb, 0x10, 0xe6, 0x47, 0xaa, 0xb2, - 0xaa, 0x10, 0xb4, 0xd2, 0xf0, 0x04, 0x01, 0x16, 0x53, 0x85, 0x05, 0x0a, 0x62, 0xc3, 0x26, 0x32, - 0xc9, 0x15, 0xb2, 0x32, 0x4c, 0x82, 0xaf, 0x53, 0x91, 0xc7, 0x83, 0x27, 0x43, 0xfe, 0x51, 0xe4, - 0x0c, 0x41, 0x62, 0x17, 0x5f, 0x9f, 0x9e, 0x63, 0xf7, 0x3b, 0x86, 0x17, 0xb2, 0x29, 0xf6, 0xbc, - 0x11, 0x15, 0x76, 0xb4, 0x27, 0x94, 0x47, 0x51, 0xe0, 0xae, 0x91, 0xb5, 0xaa, 0xd9, 0xcc, 0x8d, - 0xe3, 0x3b, 0x58, 0xbd, 0x93, 0xc8, 0x15, 0x26, 0x1f, 0x0f, 0x29, 0x76, 0x19, 0xfe, 0x68, 0x91, - 0x14, 0x63, 0x70, 0xf2, 0xc0, 0xbf, 0x63, 0x14, 0x6c, 0x82, 0xed, 0x22, 0x33, 0xdf, 0xec, 0x06, - 0x00, 0x7f, 0x36, 0x42, 0x22, 0xe5, 0x5c, 0x45, 0x13, 0xb3, 0xb3, 0x70, 0x93, 0x44, 0xc5, 0x19, - 0xac, 0x87, 0x4e, 0xd4, 0xd4, 0x0f, 0x84, 0x6c, 0x0b, 0x3a, 0x2c, 0xaf, 0xb0, 0x33, 0x6e, 0x67, - 0xb7, 0x4f, 0x76, 0x2e, 0x7c, 0xe7, 0x94, 0x21, 0x6f, 0x44, 0x8a, 0x1d, 0x7b, 0x0a, 0x53, 0xad, - 0xb2, 0xce, 0xfa, 0x33, 0x5e, 0x03, 0xfb, 0x20, 0x48, 0x59, 0x1d, 0xb9, 0xc3, 0xc5, 0x09, 0xac, - 0x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fa, 0x30, 0xbd, 0x63, 0x8d, 0x34, 0xc2, 0x3b, 0xd6, 0x58, - 0x03, 0xb4, 0x99, 0xcf, 0xd4, 0x33, 0x1b, 0x29, 0x86, 0x67, 0x36, 0x56, 0x84, 0xb7, 0xd1, 0x97, - 0x0b, 0x2e, 0xbf, 0xb5, 0xf4, 0xba, 0xa8, 0x25, 0xee, 0xbd, 0xc7, 0xfb, 0x35, 0x34, 0xaf, 0xf6, - 0xcd, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa6, 0xbd, 0xb3, 0x99, 0xd2, 0x03, 0x00, 0x00, + // 445 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0x5f, 0x8b, 0xd3, 0x40, + 0x14, 0xc5, 0x49, 0xbb, 0x4d, 0xdb, 0xbb, 0x65, 0x95, 0x69, 0x5d, 0xe3, 0xfe, 0x81, 0x92, 0xa7, + 0xb2, 0x60, 0x0b, 0xeb, 0x27, 0xc8, 0xea, 0x83, 0xa5, 0x3e, 0x48, 0xc4, 0x17, 0x1f, 0x0c, 0x63, + 0x72, 0x91, 0x21, 0x6b, 0x13, 0xe7, 0x4e, 0x8a, 0xf9, 0x78, 0xfa, 0xc9, 0x64, 0xfe, 0x50, 0x27, + 0x1a, 0x45, 0xd8, 0xb7, 0xcc, 0x9d, 0xc3, 0xb9, 0x87, 0x9c, 0x1f, 0x03, 0xcf, 0x64, 0x9d, 0x6f, + 0x78, 0x2d, 0x4a, 0x6c, 0x69, 0x43, 0x28, 0x0f, 0x22, 0xc7, 0x75, 0x2d, 0x2b, 0x55, 0xb1, 0xb1, + 0x1b, 0xc7, 0x1f, 0x61, 0xfe, 0x52, 0x22, 0x57, 0x98, 0xbc, 0xdd, 0xee, 0xb0, 0x4d, 0xf1, 0x6b, + 0x83, 0xa4, 0xd8, 0x02, 0x46, 0xaa, 0x2a, 0x71, 0x1f, 0x05, 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