Dune.Allowlist.Default (dune v0.3.15)
View SourceThe default Dune.Allowlist module to be used to allow or restrict
functions and macros that can be safely executed.
Examples
iex> Dune.Allowlist.Default.fun_status(Kernel, :+, 2)
:allowed
iex> Dune.Allowlist.Default.fun_status(String, :to_atom, 1)
:restricted
iex> Dune.Allowlist.Default.fun_status(Atom, :to_string, 1)
{:shimmed, Dune.Shims.Atom, :to_string}
iex> Dune.Allowlist.Default.fun_status(Kernel, :foo, 1)
:undefined_function
iex> Dune.Allowlist.Default.fun_status(Bar, :foo, 1)
:undefined_module
iex> Dune.Allowlist.Default.fun_status(Kernel.SpecialForms, :quote, 2)
:restrictedAllowed modules / functions
AccessAtom- Alernative implementation:
to_charlist,to_string - Restricted:
to_char_list
- Alernative implementation:
BaseBitwiseCalendar- Allowed:
compatible_calendars?,get_time_zone_database,strftime,truncate - Restricted:
put_time_zone_database
- Allowed:
Calendar.ISO- Allowed:
add_day_fraction_to_iso_days,date_from_iso_days,date_to_iodata,date_to_iso_days,date_to_string,datetime_to_iodata,datetime_to_string,day_of_era,day_of_week,day_of_year,day_rollover_relative_to_midnight_utc,days_in_month,from_unix,gregorian_seconds_to_iso_days,iso_days_to_beginning_of_day,iso_days_to_day_of_week,iso_days_to_end_of_day,iso_days_to_unit,leap_year?,microseconds_to_iodata,months_in_year,naive_datetime_from_iso_days,naive_datetime_to_iodata,naive_datetime_to_iso_days,naive_datetime_to_string,offset_to_iodata,offset_to_string,parse_date,parse_duration,parse_naive_datetime,parse_time,parse_utc_datetime,quarter_of_year,shift_date,shift_days,shift_naive_datetime,shift_time,shift_time_unit,time_from_day_fraction,time_to_day_fraction,time_to_iodata,time_to_string,time_unit_to_precision,valid_date?,valid_time?,year_of_era
- Allowed:
Date- Allowed:
__duration__!,__struct__,add,after?,before?,beginning_of_month,beginning_of_week,compare,convert,convert!,day_of_era,day_of_week,day_of_year,days_in_month,diff,end_of_month,end_of_week,from_erl,from_erl!,from_gregorian_days,from_iso8601,from_iso8601!,leap_year?,months_in_year,new,new!,quarter_of_year,range,shift,to_erl,to_gregorian_days,to_iso8601,to_iso_days,to_string,utc_today,year_of_era
- Allowed:
DateTime- Allowed:
__duration__!,__struct__,add,after?,before?,compare,convert,convert!,diff,from_gregorian_seconds,from_iso8601,from_naive,from_naive!,from_unix,from_unix!,new,new!,now,now!,shift,shift_zone,shift_zone!,to_date,to_gregorian_seconds,to_iso8601,to_naive,to_string,to_time,to_unix,truncate,utc_now
- Allowed:
Duration- Allowed:
__struct__,add,from_iso8601,from_iso8601!,multiply,negate,new!,subtract,to_iso8601,to_string
- Allowed:
Enum- Allowed:
all?,any?,at,chunk,chunk_by,chunk_every,chunk_while,concat,count,count_until,dedup,dedup_by,drop,drop_every,drop_while,each,empty?,fetch,fetch!,filter,filter_map,find,find_index,find_value,flat_map,flat_map_reduce,frequencies,frequencies_by,group_by,intersperse,into,map,map_every,map_intersperse,map_reduce,max,max_by,member?,min,min_by,min_max,min_max_by,partition,product,product_by,random,reduce,reduce_while,reject,reverse,reverse_slice,scan,shuffle,slice,slide,sort,sort_by,split,split_while,split_with,sum,sum_by,take,take_every,take_random,take_while,to_list,uniq,uniq_by,unzip,with_index,zip,zip_reduce,zip_with - Alernative implementation:
join,map_join
- Allowed:
Float- Allowed:
ceil,floor,max_finite,min_finite,parse,pow,ratio,round,to_char_list,to_charlist,to_string
- Allowed:
FunctionIO- Allowed:
iodata_length,iodata_to_binary - Alernative implementation:
chardata_to_string,inspect,puts - Restricted:
,binread,binstream,binwrite,each_binstream,each_stream,getn,gets,read,stream,warn,warn_oncewrite
- Allowed:
Integer- Allowed:
digits,extended_gcd,floor_div,gcd,is_even,is_odd,mod,parse,pow,to_char_list,to_charlist,to_string,undigits
- Allowed:
JSON- Allowed:
decode,decode! - Alernative implementation:
encode!,encode_to_iodata!,protocol_encode
- Allowed:
Kernel- Allowed:
!,!=,!==,&&,*,**,+,++,-,--,..,..//,/,<,<=,<>,==,===,=~,>,>=,abs,and,binary_part,bit_size,byte_size,ceil,div,elem,floor,get_and_update_in,get_in,hd,if,in,is_atom,is_binary,is_bitstring,is_boolean,is_exception,is_float,is_function,is_integer,is_list,is_map,is_map_key,is_nil,is_non_struct_map,is_number,is_reference,is_struct,is_tuple,length,make_ref,map_size,match?,max,min,not,or,pop_in,put_elem,put_in,raise,rem,round,self,sigil_C,sigil_D,sigil_N,sigil_R,sigil_S,sigil_T,sigil_U,sigil_c,sigil_r,sigil_s,tap,then,tl,to_timeout,trunc,tuple_size,unless,update_in,|>,|| - Alernative implementation:
apply,dbg,inspect,sigil_W,sigil_w,throw,to_charlist,to_string - Restricted:
,@,alias!,binary_slice,binding,def,defdelegate,defexception,defguard,defguardp,defimpl,defmacro,defmacrop,defmodule,defoverridable,defp,defprotocol,defstruct,destructure,exit,function_exported?,is_pid,is_port,macro_exported?,node,reraise,send,spawn,spawn_link,spawn_monitor,struct,struct!,to_char_list,usevar!
- Allowed:
Kernel.SpecialForms- Allowed:
%{},::,<<>>,=,^,__aliases__,case,cond,fn,for,with,{} - Restricted:
,%,&,.,__CALLER__,__DIR__,__ENV__,__MODULE__,__STACKTRACE__,__block__,__cursor__,alias,import,quote,receive,require,super,try,unquoteunquote_splicing
- Allowed:
Keyword- Allowed:
delete,delete_first,drop,equal?,fetch,fetch!,filter,from_keys,get,get_and_update,get_and_update!,get_lazy,get_values,has_key?,intersect,keys,keyword?,map,merge,new,pop,pop!,pop_first,pop_lazy,pop_values,put,put_new,put_new_lazy,reject,replace,replace!,replace_lazy,size,split,split_with,take,to_list,update,update!,validate,validate!,values
- Allowed:
List- Allowed:
ascii_printable?,delete,delete_at,duplicate,ends_with?,first,flatten,foldl,foldr,improper?,insert_at,keydelete,keyfind,keyfind!,keymember?,keyreplace,keysort,keystore,keytake,last,myers_difference,pop_at,replace_at,starts_with?,to_charlist,to_float,to_integer,to_tuple,update_at,wrap,zip - Alernative implementation:
to_string - Restricted:
,to_atomto_existing_atom
- Allowed:
Map- Allowed:
delete,drop,equal?,fetch,fetch!,filter,from_keys,from_struct,get,get_and_update,get_and_update!,get_lazy,has_key?,intersect,keys,map,merge,new,pop,pop!,pop_lazy,put,put_new,put_new_lazy,reject,replace,replace!,replace_lazy,size,split,split_with,take,to_list,update,update!,values
- Allowed:
MapSet- Allowed:
__struct__,delete,difference,disjoint?,equal?,filter,intersection,member?,new,put,reject,size,split_with,subset?,symmetric_difference,to_list,union
- Allowed:
NaiveDateTime- Allowed:
__duration__!,__struct__,add,after?,before?,beginning_of_day,compare,convert,convert!,diff,end_of_day,from_erl,from_erl!,from_gregorian_seconds,from_iso8601,from_iso8601!,local_now,new,new!,shift,to_date,to_erl,to_gregorian_seconds,to_iso8601,to_string,to_time,truncate,utc_now
- Allowed:
Process- Allowed:
sleep - Restricted:
,alias,alive?,cancel_timer,delete,demonitor,exit,flag,get,get_keys,group_leader,hibernate,info,link,list,monitor,put,read_timer,register,registered,send,send_after,set_label,spawn,unalias,unlink,unregisterwhereis
- Allowed:
RangeRegexStream- Allowed:
__struct__,chunk,chunk_by,chunk_every,chunk_while,concat,cycle,dedup,dedup_by,drop,drop_every,drop_while,duplicate,each,filter,filter_map,flat_map,from_index,intersperse,interval,into,iterate,map,map_every,reject,repeatedly,resource,run,scan,take,take_every,take_while,timer,transform,unfold,uniq,uniq_by,with_index,zip,zip_with
- Allowed:
String- Allowed:
at,bag_distance,byte_slice,capitalize,chunk,codepoints,contains?,count,downcase,duplicate,ends_with?,equivalent?,first,graphemes,jaro_distance,last,length,ljust,lstrip,match?,myers_difference,next_codepoint,next_grapheme,next_grapheme_size,normalize,pad_leading,pad_trailing,printable?,replace,replace_invalid,replace_leading,replace_prefix,replace_suffix,replace_trailing,reverse,rjust,rstrip,slice,split,split_at,splitter,starts_with?,strip,to_char_list,to_charlist,to_float,to_integer,trim,trim_leading,trim_trailing,upcase,valid?,valid_character? - Restricted:
,to_atomto_existing_atom
- Allowed:
Time- Allowed:
__duration__!,__struct__,add,after?,before?,compare,convert,convert!,diff,from_erl,from_erl!,from_iso8601,from_iso8601!,from_seconds_after_midnight,new,new!,shift,to_erl,to_iso8601,to_seconds_after_midnight,to_string,truncate,utc_now
- Allowed:
TupleURIVersion- Allowed:
__struct__,compare,compile_requirement,match?,parse,parse!,parse_requirement,parse_requirement!,to_string
- Allowed:
:array- Allowed:
default,fix,foldl,foldr,from_list,from_orddict,get,is_array,is_fix,map,new,relax,reset,resize,set,size,sparse_foldl,sparse_foldr,sparse_map,sparse_size,sparse_to_list,sparse_to_orddict,to_list,to_orddict
- Allowed:
:binary:erlang- Allowed:
*,+,++,-,--,/,/=,<,=/=,=:=,=<,==,>,>=,abs,adler32,adler32_combine,and,append_element,band,binary_part,binary_to_float,binary_to_integer,binary_to_list,bit_size,bitstring_to_list,bnot,bor,bsl,bsr,bxor,byte_size,ceil,convert_time_unit,crc32,crc32_combine,date,delete_element,div,element,float,float_to_binary,float_to_list,floor,hd,insert_element,integer_to_binary,integer_to_list,iolist_size,iolist_to_binary,iolist_to_iovec,is_atom,is_binary,is_bitstring,is_boolean,is_float,is_function,is_integer,is_list,is_map,is_map_key,is_number,is_pid,is_port,is_record,is_reference,is_tuple,length,list_to_binary,list_to_bitstring,list_to_float,list_to_integer,localtime,localtime_to_universaltime,make_ref,make_tuple,map_get,map_size,max,md5,md5_final,md5_init,md5_update,min,monotonic_time,not,or,phash2,ref_to_list,rem,round,setelement,size,split_binary,system_time,time,time_offset,timestamp,tl,trunc,tuple_size,tuple_to_list,unique_integer,universaltime,universaltime_to_localtime,xor - Alernative implementation:
apply - Restricted:
,!,alias,alloc_info,alloc_sizes,append,atom_to_binary,atom_to_list,binary_to_atom,binary_to_existing_atom,binary_to_term,bump_reductions,call_on_load_function,cancel_timer,check_old_code,check_process_code,decode_packet,delay_trap,delete_module,demonitor,disconnect_node,display,display_string,dist_ctrl_get_data,dist_ctrl_get_data_notification,dist_ctrl_get_opt,dist_ctrl_input_handler,dist_ctrl_put_data,dist_ctrl_set_opt,dist_get_stat,dmonitor_node,dt_append_vm_tag_data,dt_get_tag,dt_get_tag_data,dt_prepend_vm_tag_data,dt_put_tag,dt_restore_tag,dt_spread_tag,erase,error,exit,exit_signal,external_size,finish_after_on_load,finish_loading,format_cpu_topology,fun_info,fun_info_mfa,fun_to_list,function_exported,garbage_collect,garbage_collect_message_area,gather_gc_info_result,get,get_cookie,get_keys,get_module_info,group_leader,halt,has_prepared_code_on_load,hibernate,is_alive,is_builtin,is_process_alive,link,list_to_atom,list_to_existing_atom,list_to_pid,list_to_port,list_to_ref,list_to_tuple,load_module,load_nif,loaded,make_fun,match_spec_test,memory,module_loaded,monitor,monitor_node,nif_error,node,nodes,now,open_port,phash,pid_to_list,port_call,port_close,port_command,port_connect,port_control,port_get_data,port_info,port_set_data,port_to_list,ports,posixtime_to_universaltime,pre_loaded,prepare_loading,process_display,process_flag,process_info,processes,processes_iterator,processes_next,purge_module,put,raise,read_timer,register,registered,resume_process,self,send,send_after,send_nosuspend,seq_trace,seq_trace_info,seq_trace_print,set_cookie,set_cpu_topology,setnode,spawn,spawn_link,spawn_monitor,spawn_opt,spawn_request,spawn_request_abandon,start_timer,statistics,subtract,suspend_process,system_flag,system_info,system_monitor,system_profile,term_to_binary,term_to_iovec,throw,trace,trace_delivered,trace_info,trace_pattern,unalias,universaltime_to_posixtime,unlink,unregister,whereisyield
- Allowed:
:erts_debug- Allowed:
same,size,size_shared - Restricted:
,alloc_blocks_size,breakpoint,copy_shared,df,dirty,dirty_cpu,dirty_io,dis_to_file,disassemble,dist_ext_to_term,flat_size,get_internal_state,ic,instructions,interpreter_size,lc_graph,lc_graph_merge,lc_graph_to_dot,lcnt_clear,lcnt_collect,lcnt_control,map_info,set_internal_stateunaligned_bitstring
- Allowed:
:gb_sets- Allowed:
add,add_element,balance,del_element,delete,delete_any,difference,empty,filter,filtermap,fold,from_list,from_ordset,insert,intersection,is_disjoint,is_element,is_empty,is_equal,is_member,is_set,is_subset,iterator,iterator_from,larger,largest,map,new,next,singleton,size,smaller,smallest,subtract,take_largest,take_smallest,to_list,union
- Allowed:
:gb_trees- Allowed:
balance,delete,delete_any,empty,enter,from_orddict,get,insert,is_defined,is_empty,iterator,iterator_from,keys,larger,largest,lookup,map,next,size,smaller,smallest,take,take_any,take_largest,take_smallest,to_list,update,values
- Allowed:
:lists- Allowed:
all,any,append,concat,delete,droplast,dropwhile,duplicate,enumerate,filter,filtermap,flatlength,flatmap,flatten,foldl,foldr,foreach,join,keydelete,keyfind,keymap,keymember,keymerge,keyreplace,keysearch,keysort,keystore,keytake,last,map,mapfoldl,mapfoldr,max,member,merge,merge3,min,nth,nthtail,partition,prefix,reverse,rkeymerge,rmerge,rmerge3,rukeymerge,rumerge,rumerge3,search,seq,sort,split,splitwith,sublist,subtract,suffix,sum,takewhile,ukeymerge,ukeysort,umerge,umerge3,uniq,unzip,unzip3,usort,zf,zip,zip3,zipwith,zipwith3
- Allowed:
:maps:math:orddict:ordsets- Allowed:
add_element,del_element,filter,filtermap,fold,from_list,intersection,is_disjoint,is_element,is_empty,is_equal,is_set,is_subset,map,new,size,subtract,to_list,union
- Allowed:
:proplists- Allowed:
append_values,compact,delete,expand,from_map,get_all_values,get_bool,get_keys,get_value,is_defined,lookup,lookup_all,normalize,property,split,substitute_aliases,substitute_negations,to_map,unfold
- Allowed:
:queue:rand- Allowed:
bc64,bytes,bytes_s,export_seed,export_seed_s,exro928_jump_2pow20,exro928_jump_2pow512,exro928_next,exro928_next_state,exro928_seed,exsp_jump,exsp_next,float2str,format_jumpconst58,jump,make_float,mwc59,mwc59_float,mwc59_seed,mwc59_value,mwc59_value32,normal,normal_s,seed,seed58,seed_s,splitmix64_next,uniform,uniform_real,uniform_real_s,uniform_s
- Allowed:
:string- Allowed:
casefold,centre,chars,chomp,chr,concat,copies,cspan,equal,find,is_empty,jaro_similarity,join,left,len,length,lexemes,list_to_float,list_to_integer,lowercase,next_codepoint,next_grapheme,nth_lexeme,pad,prefix,rchr,replace,reverse,right,rstr,slice,span,split,str,strip,sub_string,sub_word,substr,take,titlecase,to_float,to_graphemes,to_integer,to_lower,to_upper,tokens,trim,uppercase,words
- Allowed:
:zlib- Allowed:
compress,gunzip,gzip,uncompress,unzip,zip - Restricted:
,close,deflate,deflateEnd,deflateInit,deflateParams,deflateReset,deflateSetDictionary,inflate,inflateEnd,inflateGetDictionary,inflateInit,inflateReset,inflateSetDictionary,on_load,open,safeInflateset_controlling_process
- Allowed:
Summary
Functions
Implements Dune.Allowlist.fun_status/3