(appId string)
| 720 | } |
| 721 | |
| 722 | func ReadAppManifest(appId string) (*wshrpc.AppManifest, error) { |
| 723 | if err := ValidateAppId(appId); err != nil { |
| 724 | return nil, fmt.Errorf("invalid appId: %w", err) |
| 725 | } |
| 726 | |
| 727 | appDir, err := GetAppDir(appId) |
| 728 | if err != nil { |
| 729 | return nil, err |
| 730 | } |
| 731 | |
| 732 | manifestPath := filepath.Join(appDir, ManifestFileName) |
| 733 | data, err := os.ReadFile(manifestPath) |
| 734 | if err != nil { |
| 735 | return nil, fmt.Errorf("failed to read %s: %w", ManifestFileName, err) |
| 736 | } |
| 737 | |
| 738 | var manifest wshrpc.AppManifest |
| 739 | if err := json.Unmarshal(data, &manifest); err != nil { |
| 740 | return nil, fmt.Errorf("failed to parse %s: %w", ManifestFileName, err) |
| 741 | } |
| 742 | |
| 743 | return &manifest, nil |
| 744 | } |
| 745 | |
| 746 | func ReadAppSecretBindings(appId string) (map[string]string, error) { |
| 747 | if err := ValidateAppId(appId); err != nil { |
no test coverage detected