-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extensions: Adds extensions package #4718
base: main
Are you sure you want to change the base?
Conversation
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
@@ -0,0 +1,65 @@ | |||
package extensions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package extensions | |
// Copyright (c) Microsoft Corporation. All rights reserved. | |
// Licensed under the MIT License. | |
package extensions |
func getAbsolutePath(filePath string) (string, error) { | ||
// Check if the path is absolute | ||
if filepath.IsAbs(filePath) { | ||
return filePath, nil | ||
} | ||
|
||
roots := []string{} | ||
|
||
// Get the current working directory | ||
cwd, err := os.Getwd() | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
azdConfigPath, err := config.GetUserConfigDir() | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
roots = append(roots, cwd) | ||
roots = append(roots, azdConfigPath) | ||
|
||
for _, root := range roots { | ||
// Join the root directory with the relative path | ||
absolutePath := filepath.Join(root, filePath) | ||
|
||
// Normalize the path to handle any ".." or "." segments | ||
absolutePath, err = filepath.Abs(absolutePath) | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
if _, err := os.Stat(absolutePath); err == nil { | ||
return absolutePath, nil | ||
} | ||
} | ||
|
||
return "", fmt.Errorf("file '%s' was not found, %w", filePath, os.ErrNotExist) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filepath.Abs(absolutePath)
is enough here. I don't think you need what you have here
@@ -0,0 +1,9 @@ | |||
-----BEGIN PUBLIC KEY----- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you help me understand why we need this public keys embedded ? I saw the verifySignature()
loading this public keys. Are these keys coming from the extension source you created for testing?
cc: @alexwolfmsft |
Adds the core components for the
azd
management plane ofazd
extensions.Features
Enables the following features:
microsoft.azd.pack
extension in the sample below.Core Components
The following are the core components for the
extensions
package.Registry
The top level schema for an
azd
extension registry source.Extension Metadata
Versions
List of available extension versions
Artifact
Available artifacts by platform (os & architecture)
Extension Manager
Manages and orchestrates all the top level operations of involved in extension management:
Source Manager
Manages operations for adding & removing extension sources. This will enable having official
azd
extension registry as well as support development time or internal/private extensionsExtension sources are store in
azd
user configuration.Source Types:
url
,file
Example Registry