(ctx context.Context, workDir string, showMsg bool)
| 239 | } |
| 240 | |
| 241 | func (s inlineData) GetPolicy(ctx context.Context, workDir string, showMsg bool) (string, error) { |
| 242 | dl := func(source string, dest string) (metadata.Metadata, error) { |
| 243 | fs := utils.FS(ctx) |
| 244 | |
| 245 | if err := fs.MkdirAll(dest, 0o755); err != nil { |
| 246 | return nil, err |
| 247 | } |
| 248 | |
| 249 | f := path.Join(dest, "rule_data.json") |
| 250 | m := &fileMetadata.FSMetadata{ |
| 251 | URI: source, |
| 252 | Path: dest, |
| 253 | Size: int64(len(dest)), |
| 254 | } |
| 255 | |
| 256 | return m, afero.WriteFile(fs, f, s.source, 0o400) |
| 257 | } |
| 258 | |
| 259 | dest, _, err := getPolicyThroughCache(ctx, s, workDir, dl) |
| 260 | return dest, err |
| 261 | } |
| 262 | |
| 263 | func (s inlineData) PolicyUrl() string { |
| 264 | return "data:application/json;base64," + base64.StdEncoding.EncodeToString(s.source) |
nothing calls this directly
no test coverage detected