Skip to content

Commit

Permalink
docs: cleanup (kyverno#203)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
  • Loading branch information
eddycharly committed Nov 7, 2024
1 parent f27caf6 commit eb70536
Show file tree
Hide file tree
Showing 25 changed files with 306 additions and 1,356 deletions.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ install-cert-manager: $(HELM)
install-cluster-issuer: ## Install cert-manager cluster issuer
install-cluster-issuer:
@echo Install cert-manager cluster issuer... >&2
@kubectl apply -f manifests/cert-manager/cluster-issuer.yaml
@kubectl apply -f .manifests/cert-manager/cluster-issuer.yaml

#########
# ISTIO #
Expand Down Expand Up @@ -353,7 +353,6 @@ install-kyverno-sidecar-injector: $(HELM)
.PHONY: install-kyverno-authz-server
install-kyverno-authz-server: ## Install kyverno-authz-server chart
install-kyverno-authz-server: kind-load-image
install-kyverno-authz-server: codegen-crds
install-kyverno-authz-server: $(HELM)
@echo Install CRDs... >&2
@kubectl apply -f $(CRDS_PATH)
Expand Down
212 changes: 0 additions & 212 deletions docs/quick_start.yaml

This file was deleted.

12 changes: 8 additions & 4 deletions pkg/authz/cel/libs/jwt/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (*lib) extendEnv(env *cel.Env) (*cel.Env, error) {
// build our function overloads
libraryDecls := map[string][]cel.FunctionOpt{
"jwt.Decode": {
cel.Overload("decode_string_string", []*cel.Type{types.StringType, types.StringType}, TokenType, cel.BinaryBinding(decode)),
cel.Overload("decode_string_string", []*cel.Type{types.StringType, types.StringType}, types.DynType, cel.BinaryBinding(decode)),
},
}
// create env options corresponding to our function overloads
Expand All @@ -54,11 +54,15 @@ func decode(token ref.Val, key ref.Val) ref.Val {
if !ok {
return types.MaybeNoSuchOverloadErr(key)
}
out, err := jwt.Parse(string(t), func(*jwt.Token) (any, error) {
parsed, err := jwt.Parse(string(t), func(*jwt.Token) (any, error) {
return []byte(k), nil
})
if err != nil {
return types.WrapErr(err)
return types.DefaultTypeAdapter.NativeToValue(nil)
}
return Token{Token: out}
return types.DefaultTypeAdapter.NativeToValue(map[string]any{
"header": parsed.Header,
"claims": parsed.Claims.(jwt.MapClaims),
"valid": parsed.Valid,
})
}
1 change: 1 addition & 0 deletions pkg/policy/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func (r *policyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
}
compiled, err := r.compiler.Compile(policy)
if err != nil {
fmt.Println(err)
// TODO: not sure we should retry it
return ctrl.Result{}, err
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/cel-extensions/jwt.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kind: AuthorizationPolicy
metadata:
name: demo
spec:
failurePolicy: Ignore
failurePolicy: Fail
variables:
- name: token
expression: >
Expand Down
15 changes: 0 additions & 15 deletions website/docs/jp.md

This file was deleted.

Loading

0 comments on commit eb70536

Please sign in to comment.